-/*\r
- * @file lexical_cast.h\r
- *\r
- * L7VSD: Linux Virtual Server for Layer7 Load Balancing\r
- * Copyright (C) 2008 NTT COMWARE Corporation.\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\r
- * 02110-1301 USA\r
- * \r
- **********************************************************************/\r
-\r
-#ifndef __LEXICAL_CAST_H__\r
-#define __LEXICAL_CAST_H__\r
-\r
-#include <string>\r
-#include <sstream>\r
-\r
-namespace l7vs\r
-{\r
- class bad_lexical_cast : public std::bad_cast\r
- {\r
- public:\r
- bad_lexical_cast() {}\r
- };\r
-\r
- template <typename T>\r
- T lexical_cast(const std::string& s)\r
- {\r
- std::stringstream ss;\r
- T d;\r
- ss << s.c_str();\r
- while( !ss.eof() ){\r
- ss >> d;\r
- if(ss.fail()) {\r
- throw bad_lexical_cast();\r
- }\r
- }\r
- return d;\r
- }\r
-}\r
-\r
-#endif //__LEXICAL_CAST_H__\r
+/*
+ * @file lexical_cast.h
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2008 NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
+#ifndef __LEXICAL_CAST_H__
+#define __LEXICAL_CAST_H__
+
+#include <string>
+#include <sstream>
+
+namespace l7vs
+{
+ class bad_lexical_cast : public std::bad_cast
+ {
+ public:
+ bad_lexical_cast() {}
+ };
+
+ template <typename T>
+ T lexical_cast(const std::string& s)
+ {
+ std::stringstream ss;
+ T d;
+ ss << s.c_str();
+ while( !ss.eof() ){
+ ss >> d;
+ if(ss.fail()) {
+ throw bad_lexical_cast();
+ }
+ }
+ return d;
+ }
+}
+
+#endif //__LEXICAL_CAST_H__