MCPcopy Create free account
hub / github.com/SOUI2/soui / parseConfigFromString

Function parseConfigFromString

components/log4z/log4z.cpp:780–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780static bool parseConfigFromString(std::string content, std::map<std::string, LoggerInfo> & outInfo)
781{
782
783 std::string key;
784 int curLine = 1;
785 std::string line;
786 std::string::size_type curPos = 0;
787 if (content.empty())
788 {
789 return true;
790 }
791 do
792 {
793 std::string::size_type pos = std::string::npos;
794 for (std::string::size_type i = curPos; i < content.length(); ++i)
795 {
796 //support linux/unix/windows LRCF
797 if (content[i] == '\r' || content[i] == '\n')
798 {
799 pos = i;
800 break;
801 }
802 }
803 line = content.substr(curPos, pos - curPos);
804 parseConfigLine(line, curLine, key, outInfo);
805 curLine++;
806
807 if (pos == std::string::npos)
808 {
809 break;
810 }
811 else
812 {
813 curPos = pos+1;
814 }
815 } while (1);
816 return true;
817}
818
819
820

Callers 1

configFromStringImplMethod · 0.85

Calls 3

parseConfigLineFunction · 0.85
emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected