ManaPlus
Functions
parameters.h File Reference

(986a3bf)

#include "utils/stringvector.h"
#include "localconsts.h"

Go to the source code of this file.

Functions

bool splitParameters (StringVect &tokens, std::string text, const std::string &separator, const char quote)
 

Function Documentation

◆ splitParameters()

bool splitParameters ( StringVect tokens,
std::string  text,
const std::string &  separator,
const char  quote 
)

Definition at line 103 of file parameters.cpp.

107 {
108  size_t idx = findNextSplit(text, separator, quote);
109 
110  while (idx != std::string::npos)
111  {
112  std::string item = text.substr(0, idx);
113  addToken(tokens, item);
114  text = text.substr(idx + 1);
115  idx = findNextSplit(text, separator, quote);
116  }
117 
118  addToken(tokens, text);
119  return true;
120 }
static size_t findNextSplit(const std::string &str, const std::string &separator, const char quote) A_INLINE
Definition: parameters.cpp:72
static void addToken(StringVect &tokens, std::string str) A_INLINE
Definition: parameters.cpp:30

References addToken(), and findNextSplit().