コード例 #1
0
size_t PreprocessorBlock::GetExpandedLength () const {
    vector<ScriptSource *>::const_iterator
    it = m_inc_sources.begin(),
    it_end = m_inc_sources.end();

    size_t size = 0;

    for (; it != it_end; it++) {
        ScriptSource *pIncludeSource = *it;
        size+= pIncludeSource->GetLength ();
    }

    return size;
}
コード例 #2
0
int PreprocessorBlock::ExpandBlock (sys_wchar **p_pCodeBuffer) {
    sys_wchar *pCodeBuffer = *p_pCodeBuffer;

    vector<ScriptSource *>::const_iterator
    it = m_inc_sources.begin(),
    it_end = m_inc_sources.end();

    size_t size = 0;

    for (; it != it_end; it++) {
        ScriptSource *pIncludeSource = *it;
        size_t codeLength = pIncludeSource->GetLength();

        memcpy (pCodeBuffer, pIncludeSource->GetCode(), codeLength * sizeof(sys_wchar));
        pCodeBuffer+= codeLength;
    }

    *p_pCodeBuffer = pCodeBuffer;
    return kPrepErrorNone;
}