Library for LoRa communication using MultiTech MDOT.

Dependents:   mDot_test_rx adc_sensor_lora mDotEVBM2X mDot_AT_firmware ... more

Embed: (wiki syntax)

« Back to documentation index

Text Class Reference

Text Class Reference

This class contains a number of static methods for manipulating strings and other text data. More...

#include <MTSText.h>

Static Public Member Functions

static std::string getLine (const std::string &source, const size_t &start, size_t &cursor)
 This static method can be used to pull out a string at the next line break.
static std::vector< std::string > split (const std::string &str, char delimiter, int limit=0)
 This is a static method for splitting strings using a delimeter value.
static std::vector< std::string > split (const std::string &str, const std::string &delimiter, int limit=0)
 This is a static method for splitting strings using a delimeter value.

Detailed Description

This class contains a number of static methods for manipulating strings and other text data.

Definition at line 17 of file MTSText.h.


Member Function Documentation

static std::string getLine ( const std::string &  source,
const size_t &  start,
size_t &  cursor 
) [static]

This static method can be used to pull out a string at the next line break.

A break can either be a newline '
', carriage return '' or both.

Parameters:
sourcethe source string to look for the line break on.
startthe start postion within the string to begin looking for the line break.
cursorthis value will be updated with the index for the next available character after the line break. If a line break is not found returns -1.
Returns:
the string beginning with the start index up to including the line breaks.
static std::vector<std::string> split ( const std::string &  str,
const std::string &  delimiter,
int  limit = 0 
) [static]

This is a static method for splitting strings using a delimeter value.

Parameters:
strthe string to try and split.
delimiterthe delimeter value to split on as a string.
limitthe maximum number of splits. If equal to 0 it splits as amny times as possible. The default is 0.
Returns:
an ordered vector of strings conatining the splits of the original string.
static std::vector<std::string> split ( const std::string &  str,
char  delimiter,
int  limit = 0 
) [static]

This is a static method for splitting strings using a delimeter value.

Parameters:
strthe string to try and split.
delimiterthe delimeter value to split on as a character.
limitthe maximum number of splits. If equal to 0 it splits as amny times as possible. The default is 0.
Returns:
an ordered vector of strings conatining the splits of the original string.