OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
csvtools::StringField Class Reference

Public Types

using iterator = std::string::const_iterator
 

Public Member Functions

 StringField (std::string const &line, const std::size_t b, const std::size_t e)
 
 StringField (StringField const &other, const std::size_t b, const std::size_t e)
 
 StringField (StringField const &other)=default
 
std::size_t beginPos () const
 return the beginning position, which is a valid position in the string.
 
std::size_t virtualEndPos () const
 
std::size_t endPos () const
 
std::size_t realLength () const
 gets the length of the field
 
std::size_t lengthForSubstr () const
 
bool empty () const
 Is the field/range empty?
 
std::string const & getLine () const
 Access (by reference) the full line.
 
std::string substr () const
 Make a copy of the range as a substring.
 
iterator begin () const
 Get a begin iterator.
 
iterator end () const
 Get an end iterator.
 
char front () const
 
char back () const
 
StringField stripQuotes () const
 
void loadIntoStringStream (std::istringstream &iss) const
 

Detailed Description

Definition at line 98 of file CSVTools.h.

Member Function Documentation

std::size_t csvtools::StringField::virtualEndPos ( ) const
inline

return the virtual one-past-the-end position - may point one past the end of the array but isn't std::string::npos.

Definition at line 120 of file CSVTools.h.

std::size_t csvtools::StringField::endPos ( ) const
inline

return the one-past-the-end position, which may be std::string::npos if the range includes the rest of the string.

Definition at line 124 of file CSVTools.h.

std::size_t csvtools::StringField::lengthForSubstr ( ) const
inline

like realLength, except returns std::string::npos when the end includes the rest of the string.

Definition at line 131 of file CSVTools.h.

StringField csvtools::StringField::stripQuotes ( ) const
inline

Get a StringField object based on this one where outer quotation marks, if present, have been removed.

Too short to be wrapped in quotes.

Not wrapped in quotes.

Definition at line 176 of file CSVTools.h.

void csvtools::StringField::loadIntoStringStream ( std::istringstream &  iss) const
inline
Todo:
might be able to do stuff with streambuf::sputn to make this more efficient, but...

Definition at line 190 of file CSVTools.h.


The documentation for this class was generated from the following file: