$search
00001 /* 00002 * Copyright (C) 2009 00003 * Robert Bosch LLC 00004 * Research and Technology Center North America 00005 * Palo Alto, California 00006 * 00007 * All rights reserved. 00008 * 00009 *------------------------------------------------------------------------------ 00010 * project ....: Autonomous Technologies 00011 * file .......: rtcStringTools.h 00012 * authors ....: Benjamin Pitzer 00013 * organization: Robert Bosch LLC 00014 * creation ...: 04/16/2007 00015 * modified ...: $Date: 2009-01-21 18:19:16 -0800 (Wed, 21 Jan 2009) $ 00016 * changed by .: $Author: benjaminpitzer $ 00017 * revision ...: $Revision: 14 $ 00018 */ 00019 #ifndef RTC_STRINGTOOLS_H 00020 #define RTC_STRINGTOOLS_H 00021 00022 //== INCLUDES ================================================================== 00023 #include <string> 00024 #include <vector> 00025 00026 //== NAMESPACES ================================================================ 00027 namespace rtc { 00028 00030 bool lexical_cast_bool(const std::string& str, const bool bDefault = false); 00032 int lexical_cast_int(const std::string& str, const int nDefault = 0); 00034 float lexical_cast_float(const std::string& str, const float fDefault = 0.0f); 00036 double lexical_cast_double(const std::string& str, const double dDefault = 0.0); 00038 long lexical_cas_long(const std::string& str, const long lDefault = 0); 00040 std::string lexical_cast_string(const double& var); 00042 std::string lexical_cast_string(const float& var); 00044 std::string lexical_cast_string(const bool& var); 00046 std::string lexical_cast_string(const int& var); 00048 void split_string(const std::string& str, std::vector<std::string>& tokens, const std::string& delimiters = " "); 00050 std::string& trim(std::string& str); 00051 00052 //============================================================================== 00053 } // NAMESPACE rtc 00054 //============================================================================== 00055 #endif // RTC_STRINGTOOLS_H defined 00056 //==============================================================================