Logo Search packages:      
Sourcecode: einstein version File versions  Download package

void Messages::loadFromResource ( Resource res,
Buffer buffer 
)

Load messages from resource

Parameters:
res resource

Definition at line 44 of file messages.cpp.

References Buffer::getData(), ResVariant::getData(), ResVariant::getI18nScore(), Exception::getMessage(), Resource::getName(), Buffer::getSize(), Resource::getVariant(), and Resource::getVariantsCount().

{
    if (! res) return;

    int cnt = res->getVariantsCount();
    for (int i = 0; i < cnt; i++) {
        ResVariant *var = res->getVariant(i);
        if (var) {
            try {
                int score = var->getI18nScore();
                var->getData(*buffer);
                loadBundle(score, (unsigned char*)buffer->getData(), 
                        buffer->getSize());
            } catch (Exception &e) {
                std::cerr << std::wstring(L"Error loading text bundle " +
                        res->getName() + L": " + e.getMessage());
            }
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index