LogString format(const LogString& pattern,
     const ObjectPtr& obj) {
     std::vector<PatternConverterPtr> converters;
     std::vector<FormattingInfoPtr> fields;
     PatternMap rules;
     rules.insert(PatternMap::value_type(LOG4CXX_STR("d"), (PatternConstructor) FileDatePatternConverter::newInstance));
     rules.insert(PatternMap::value_type(LOG4CXX_STR("i"), (PatternConstructor) IntegerPatternConverter::newInstance));
     PatternParser::parse(pattern, converters, fields, rules);
     LogString result;
     Pool pool;
     std::vector<FormattingInfoPtr>::const_iterator fieldIter = fields.begin();
     for(std::vector<PatternConverterPtr>::const_iterator converterIter = converters.begin();
         converterIter != converters.end();
         converterIter++, fieldIter++) {
         LogString::size_type i = result.length();
         (*converterIter)->format(obj, result, pool);
         (*fieldIter)->format(i, result);
     }
     return result;
 }
Beispiel #2
0
void insertExactPattern(PatternPair p) {
	sExactPatterns.insert(p);
}
Beispiel #3
0
void insertPattern(PatternPair p) {
	sRootPatterns.insert(p);
}