Changeset 10172
- Timestamp:
- 07/26/10 12:34:52 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/trunk/system/ossie/parser/prop_helpers.cpp
r10161 r10172 30 30 #include <ossie/prop_helpers.h> 31 31 32 static const std::vector<std::string> trueValues = {"true", "t", "on", "yes", "1"};32 static std::vector<std::string> trueValues; 33 33 34 34 CORBA::Boolean ossieSupport::strings_to_boolean(std::vector<std::string> &values) 35 35 { 36 trueValues.push_back("true"); 37 trueValues.push_back("t"); 38 trueValues.push_back("on"); 39 trueValues.push_back("yes"); 40 trueValues.push_back("1"); 41 36 42 std::string localValue = values[0]; 37 43 38 std::transform(localValue.begin(), localValue.end(), localValue.begin(), std::tolower); 39 40 return CORBA::Boolean(trueValues.contains(localValue)); 44 for(int i = 0; localValue[i] != '\0'; i++) 45 localValue[i] = tolower(localValue[i]); 46 47 for(int i = 0; i < 5; i++) 48 { 49 if(trueValues[i] == localValue) 50 return CORBA::Boolean(true); 51 } 52 53 return CORBA::Boolean(false); 41 54 } 42 55