示例#1
0
void SimpleStlVectorData<T>::Serialize(ArchiveXML& archive)
{
    archive.GetIndent().Push();

    // foreach datum
    for (size_t i=0; i<m_Data->size(); i++)
    {
        // indent
        archive.GetIndent().Get(archive.GetStream());

        // write
        archive.GetStream() << m_Data->at( i );

        // newline
        archive.GetStream() << "\n";
    }

    archive.GetIndent().Pop();
}
示例#2
0
void StlStringStlVectorData::Serialize(ArchiveXML& archive)
{
    archive.GetIndent().Push();
    archive.GetIndent().Get(archive.GetStream());

    // start our CDATA section, this prevents XML from parsing its escapes in this cdata section
    archive.GetStream() << TXT("<![CDATA[\n");

    for (size_t i=0; i<m_Data->size(); i++)
    {
        archive.GetIndent().Get(archive.GetStream());

        // output the escape-code free character sequence between double qutoes
        archive.GetStream() << TXT('\"') << m_Data->at( i ) << TXT('\"') << s_ContainerItemDelimiter;
    }

    // end our CDATA escape section
    archive.GetIndent().Get(archive.GetStream());
    archive.GetStream() << TXT("]]>\n");

    archive.GetIndent().Pop();
}