Get next token till end of input
| 714 | /// <param name="out"></param> |
| 715 | /// <returns></returns> |
| 716 | bool GetTokenNext(std::string& in, std::string delim, std::string& out) { |
| 717 | size_t pos = in.find(delim); |
| 718 | if (pos != std::string::npos) { |
| 719 | out = in.substr(0, pos); |
| 720 | in = in.substr(pos + delim.length(), in.length()); |
| 721 | } else { |
| 722 | out = in; |
| 723 | in = ""; |
| 724 | } |
| 725 | return !(in.empty() && out.empty()); |
| 726 | } |
| 727 | |
| 728 | /// returns next token, "" if done or first empty token |
| 729 | std::string TokenNext(std::string& in, std::string delim) { |