packages/hyperloop-ios-metabase/src/util.cpp
void tokenizeArguments (std::string str, std::vector<std::string> &args) {
		size_t offset = 0;
		size_t len = str.length();
		size_t index = 0;
		while (offset < len) {
			auto pos = str.find(",", offset);
			if (pos == std::string::npos) {
				break;
			}
			auto part = str.substr(index, pos - index);
			if (bracesMatch(part)) {
				// matching braces
				part = trim(part);
				args.push_back(part);
				index = pos + 1;
			}
			offset = pos + 1;
		}
		auto remaining = str.substr(index);
		if (!remaining.empty()) {
			remaining = trim(remaining);
			if (!bracesMatch(remaining) && remaining.at(remaining.length()-1) == (int)')') {
				remaining = remaining.substr(0, remaining.length() - 1);
			}
			args.push_back(remaining);
		}
	}
/**
	 * tokenize an argument list. this is different than the tokenize above in
	 * that is must pay special attention to embedded arguments with commas such
	 * as classes with protocols:
	 *
	 * id<Foo>, id<Bar, Another>, int
	 */
tokenize an argument list. this is different than the tokenize above in
that is must pay special attention to embedded arguments with commas such
as classes with protocols.

id, id, int
tokenize an argument list . this is different than the tokenize above in that is must pay special attention to embedded arguments with commas such as classes with protocols . id id int
void tokenizeArguments (std::string str, std::vector<std::string> &args) {
		size_t offset = 0;
		size_t len = str.length();
		size_t index = 0;
		while (offset < len) {
			auto pos = str.find(",", offset);
			if (pos == std::string::npos) {
				break;
			}
			auto part = str.substr(index, pos - index);
			if (bracesMatch(part)) {
				part = trim(part);
				args.push_back(part);
				index = pos + 1;
			}
			offset = pos + 1;
		}
		auto remaining = str.substr(index);
		if (!remaining.empty()) {
			remaining = trim(remaining);
			if (!bracesMatch(remaining) && remaining.at(remaining.length()-1) == (int)')') {
				remaining = remaining.substr(0, remaining.length() - 1);
			}
			args.push_back(remaining);
		}
	}
void tokenizeArguments ( std :: string str , std :: vector < std :: string > & args ) { size_t offset = 0 ; size_t len = str . length ( ) ; size_t index = 0 ; while ( offset < len ) { auto pos = str . find ( " " , offset ) ; if ( pos == std :: string :: npos ) { break ; } auto part = str . substr ( index , pos - index ) ; if ( bracesMatch ( part ) ) { part = trim ( part ) ; args . push_back ( part ) ; index = pos + 1 ; } offset = pos + 1 ; } auto remaining = str . substr ( index ) ; if ( ! remaining . empty ( ) ) { remaining = trim ( remaining ) ; if ( ! bracesMatch ( remaining ) && remaining . at ( remaining . length ( ) - 1 ) == ( int ) ' ' ) { remaining = remaining . substr ( 0 , remaining . length ( ) - 1 ) ; } args . push_back ( remaining ) ; } }
tokenize an argument list.
tokenize an argument list .
// matching braces