S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_conversion Class Reference

Currently we can convert 'to string' or 'from string'. More...

#include <s3_conversion.h>

List of all members.

Static Public Methods

template<typename T> std::string to_string (const T &t)
 Convert argument from T to string using stringstream. More...

template<class T> T from_string (const std::string &s)
 Convert argument from string to T using stringstream. More...

std::vector< std::string > string_to_vec_string (const std::string &str)
 Convert string argument into a vector of string, each entry containing a single word from str. More...

std::vector< int > string_to_vec_int (const std::string &str)
 Convert string argument into a vector of int. More...

std::vector< float > string_to_vec_float (const std::string &str)
 Convert string argument into a vector of float. More...

std::vector< std::string > split_string (const std::string &str, const char *delim=0)
 Split string into substrings and return as a vector of strings. More...


Detailed Description

Currently we can convert 'to string' or 'from string'.

Definition at line 44 of file s3_conversion.h.


Member Function Documentation

std::string s3_conversion::from_string< std::string > const std::string &    s [inline, static]
 

Convert argument from string to T using stringstream.

Parameters:
t  Input to be converted from string

Definition at line 65 of file s3_conversion.h.

std::vector< std::string > s3_conversion::split_string const std::string &    str,
const char *    delim = 0
[static]
 

Split string into substrings and return as a vector of strings.

Substrings are delimited by any single character contained in delim. If no delimeter is specified, it is assumed that whitespace are used to delimit the fields. In this case, the returned substrings are guaranteed to have no leading or trailing whitespace.

Parameters:
str  Input string.
delim  Substring delimiter set. Optional - defaults to 0, indicating delimit on whitespace.

Definition at line 107 of file s3_conversion.cc.

Referenced by s3_rpc_server::exec_cmd_call.

std::vector< float > s3_conversion::string_to_vec_float const std::string &    str [static]
 

Convert string argument into a vector of float.

Parameters:
str  String argument.
Returns:
vector of float.

Definition at line 92 of file s3_conversion.cc.

References string_to_vec_string.

std::vector< int > s3_conversion::string_to_vec_int const std::string &    str [static]
 

Convert string argument into a vector of int.

Parameters:
str  String argument.
Returns:
vector of int.

Definition at line 77 of file s3_conversion.cc.

References string_to_vec_string.

std::vector< std::string > s3_conversion::string_to_vec_string const std::string &    str [static]
 

Convert string argument into a vector of string, each entry containing a single word from str.

Parameters:
str  String argument.
Returns:
vector of string.

Definition at line 51 of file s3_conversion.cc.

Referenced by s3_post_office_switch::main_loop, string_to_vec_float, and string_to_vec_int.

template<typename T>
std::string s3_conversion::to_string const T &    t [inline, static]
 

Convert argument from T to string using stringstream.

Parameters:
t  Input to be converted to string.

Definition at line 53 of file s3_conversion.h.

Referenced by s3_msgb_log_buffer::s3_msgb_log_buffer.


The documentation for this class was generated from the following files:
Send comments to: s3fc@stonethree.com SourceForge Logo