Chain Class Reference

#include <Chain.h>

Description

Allows for easy string building and deconstructing.

Chains have 2 primary responsibilities:

  • Allow a mechanism to easily concatenate multiple different types
  • Break up a string into consumable tokens.

Functions

Chainoperator<< (const Chain &)
 
const std::string & ToString () const
 
Chainoperator= (const Chain &)
 
 operator std::string () const
 
std::string GetLink ()
 
uint32_t GetLinkPos ()
 
bool LinksLeft ()
 
void GoToFirst ()
 
void SetDelimiters (const std::string &chars)
 
Instantiation

A chain can be initalized from any of the following types:

 Chain (const char *)
 
 Chain (char)
 
 Chain (int)
 
 Chain (uint32_t)
 
 Chain (uint64_t)
 
 Chain (double)
 
 Chain (const Vector &)
 
 Chain (const Chain &)
 
 Chain (const std::string &other)
 
 Chain (const std::vector< Chain > &)
 
Numerical conversion to other types

If the type has no correct conversion, a default value of 0 is used.

int AsInt ()
 
uint32_t AsUInt32 ()
 
uint64_t AsUInt64 ()
 
float AsFloat ()
 
double AsDouble ()
 
Translate the Chain to and from the Al Bhed language.
std::string TranslateToAlBhed () const
 
std::string TranslateFromAlBhed () const
 
Goes to the next token in the Chain.

If there are not more links in the chain, the current link is an empty Chain.

void NextLink ()
 
Chainoperator++ (int)
 

Member Function Documentation

Chain& operator<< ( const Chain )

Appends *this with an input

const std::string& ToString ( ) const
inline

Returns a std::string equivalent of this Chain.

Chain& operator= ( const Chain )

Assign a value to be the Chain.

operator std::string ( ) const
inline

copy constructor allowing for implicit conversion to std::string s.

std::string GetLink ( )

returns the current link;

uint32_t GetLinkPos ( )

Returns the position in the whole string where the current link begins.

bool LinksLeft ( )

returns if there are any links left

void GoToFirst ( )

Goes back to the first link for reading.

void SetDelimiters ( const std::string &  chars)

Set the delimiters to define what each link is composed of. The default delimiters are space, newline, tab, and return.

Parameters
charsA string of characters where each character is a delimiter.

The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Util/Chain.h