Attention

This functionality is only available in the C++ toolkits. For other languages, we recommend using language-specific functionality instead.

OEStringTokenizeQuoted

bool OEStringTokenizeQuoted(std::list<std::string> &strgrp, const std::string &str,
                            const std::string & delim =" \t\n",
                            const std::string & quote ="\'\"",
                            bool concat_delim=true)
bool OEStringTokenizeQuoted(std::vector<std::string> &strgrp, const std::string &str,
                            const std::string & delim =" \t\n",
                            const std::string & quote ="\'\"",
                            bool concat_delim=true)

Break up the specified input string str into individual tokens based on the specified delimiters delim while maintaining the integrity of quoted text specified by quote delimiters quote. The resulting tokens are stored in the specified string group strgrp. This function always returns true.

The concat_delim parameter specifies whether consecutive delimiters should be treated as a single delimiter. If false, empty strings will be output into strgrp between consecutive delimiters.

The defaults of this function are set up for parsing whitespace separated fields usually found in configuration files. For parsing comma separated or tab separated file formats, the OEStringCSVTokenize will be easier to use.