src/Generic/values/NumberConverter.cpp
/**
 * Split multi-token number strings and convert them recursively,
 * tracking places.
 **/
Split multi-token number strings and convert them recursively,
tracking places.
Split multi - token number strings and convert them recursively tracking places .
int NumberConverter::convertComplexNumberWord(const std::wstring& str) {
	int ret = convertComplexTwoPartNumberWord(str);
	if (ret != INT_MIN) { 
		return ret;
	}
	std::vector<std::wstring> list_of_numbers;
	std::vector<int> list_of_ints;
	boost::split(list_of_numbers, str, boost::is_any_of(L"-"));
	BOOST_FOREACH(std::wstring valI, list_of_numbers) {
		std::vector<std::wstring> tmp_num_list;
		boost::split(tmp_num_list, valI, boost::is_any_of(L" "));
		BOOST_FOREACH(std::wstring valJ, tmp_num_list) {
			std::vector<std::wstring> oth_tmp_list;
			boost::split(oth_tmp_list, valJ, boost::is_any_of(L"\n"));
			BOOST_FOREACH(std::wstring valK, oth_tmp_list) {
				list_of_ints.push_back(convertNumberWord(valK));
			}
		}
	}
	return calculateValue(list_of_ints);
}
int NumberConverter :: convertComplexNumberWord ( const std :: wstring & str ) { int ret = convertComplexTwoPartNumberWord ( str ) ; if ( ret != INT_MIN ) { return ret ; } std :: vector < std :: wstring > list_of_numbers ; std :: vector < int > list_of_ints ; boost :: split ( list_of_numbers , str , boost :: is_any_of ( L" " ) ) ; BOOST_FOREACH ( std :: wstring valI , list_of_numbers ) { std :: vector < std :: wstring > tmp_num_list ; boost :: split ( tmp_num_list , valI , boost :: is_any_of ( L" " ) ) ; BOOST_FOREACH ( std :: wstring valJ , tmp_num_list ) { std :: vector < std :: wstring > oth_tmp_list ; boost :: split ( oth_tmp_list , valJ , boost :: is_any_of ( L" \n " ) ) ; BOOST_FOREACH ( std :: wstring valK , oth_tmp_list ) { list_of_ints . push_back ( convertNumberWord ( valK ) ) ; } } } return calculateValue ( list_of_ints ) ; }
Split multi-token number strings and convert them recursively,
 tracking places.
Split multi - token number strings and convert them recursively tracking places .
// INT_MIN signals invalid value
 // Split on hyphens or whitespace
 // Now list_of_ints is a flat list of values
