| 778 | } |
| 779 | |
| 780 | static 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 |
no test coverage detected