Exemplo n.º 1
0
beast::StringPairArray
parseKeyValueSection (Section& secSource, beast::String const& strSection)
{
    beast::StringPairArray result;

    // yuck.
    std::string const stdStrSection (strSection.toStdString ());

    typedef Section::mapped_type Entries;

    Entries* const entries = SectionEntries (secSource, stdStrSection);

    if (entries != nullptr)
    {
        for (Entries::const_iterator iter = entries->begin (); iter != entries->end (); ++iter)
        {
            beast::String const line (iter->c_str ());

            int const equalPos = line.indexOfChar ('=');

            if (equalPos != -1)
            {
                beast::String const key = line.substring (0, equalPos);
                beast::String const value = line.substring (equalPos + 1, line.length ());

                result.set (key, value);
            }
        }
    }

    return result;
}
Exemplo n.º 2
0
Value::Value (beast::String const& beastString)
    : type_ ( stringValue )
    , allocated_ ( true )
{
    value_.string_ = valueAllocator ()->duplicateStringValue ( beastString.toStdString ().c_str (),
                     (unsigned int)beastString.length () );

}
Exemplo n.º 3
0
Value::Value (beast::String const& beastString)
    : type_ ( stringValue )
    , allocated_ ( true )
    , comments_ ( 0 )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
    , itemIsUsed_ ( 0 )
#endif
{
    value_.string_ = valueAllocator ()->duplicateStringValue ( beastString.toStdString ().c_str (),
                     (unsigned int)beastString.length () );

}