//从字符串str中,使用pattern进行分割,并存储到strVec中
void SplitString(std::string src, std::string delimStr, std::vector<std::string>& strVec)
{
src += delimStr;//扩展字符串以方便操作
std::size_t pos = src.find(delimStr);
std::size_t posBegin = 0;
while( std::string::npos != pos )
{
std::string s=src.substr(posBegin, pos-posBegin);
strVec.push_back(s);
pos += delimStr.length();
posBegin = pos;
pos = src.find(delimStr, posBegin);
}
}