void Foam::dictionaryEntry::write(Ostream& os) const
{
    // write keyword with indent but without trailing spaces
    os.indent();
    os.write(keyword());
    dictionary::write(os);
}
示例#2
0
void Foam::primitiveEntry::write(Ostream& os, const bool contentsOnly) const
{
    if (!contentsOnly)
    {
        os.writeKeyword(keyword());
    }

    for (label i=0; i<size(); ++i)
    {
        const token& t = operator[](i);
        if (t.type() == token::VERBATIMSTRING)
        {
            // Bypass token output operator to avoid losing verbatimness.
            // Handle in Ostreams themselves
            os.write(t);
        }
        else
        {
            os  << t;
        }

        if (i < size()-1)
        {
            os  << token::SPACE;
        }
    }

    if (!contentsOnly)
    {
        os  << token::END_STATEMENT << endl;
    }
}