rcolyer.net
RC Lib  Version 202403231100
Classes | Namespaces | Typedefs | Enumerations | Functions
RStr.h File Reference

Provides a robust value-added wrapper for std::string. More...

#include "RCconfig.h"
#include "Macros.h"
#include "Types.h"
#include "Errors.h"
#include "RCBits.h"
#include "Data1D.h"
#include "Data2D.h"
#include "Data3D.h"
#include "Iter.h"
#include <tchar.h>
#include <algorithm>
#include <ctype.h>
#include <errno.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <QString>

Go to the source code of this file.

Classes

class  RC::RStr
 A bounds-safe string class which provides an identical interface to std::string plus many convenience functions for string manipulation. More...
 
class  RC::PluralStr
 Provides number-based singular/plural string management. More...
 

Namespaces

 RC
 

Macros

Convert to and from other supported types
#define RC_RSTR_Int_Input(TYPE)
 Internal. More...
 
#define RC_RSTR_Float_Input(TYPE)
 Internal. More...
 

Typedefs

typedef RAIter< RStr, char > RC::RStrIter
 The random-access iterator for RStr begin() and end()
 

Enumerations

enum  RC::RStr_IntStyle {
  DEC =100000 , HEX , HEX0x , OCT ,
  OCT0 , BIN , CHAR
}
 The styles in which an integral number can be formatted. More...
 
enum  RC::RStr_FloatStyle { AUTO =100000 , FIXED , SCI }
 The styles in which a floating point number can be formatted. More...
 

Functions

RStr RC::operator+ (const RStr &lhs, const RStr &rhs)
 Concatenates two RStr'ings.
 
std::istream & RC::operator>> (std::istream &in, RStr &rstr)
 Input text from a std::istream (e.g., std::cin) into an RStr.
 
std::ostream & RC::operator<< (std::ostream &out, const RStr &rstr)
 Output text from an RStr to a std::ostream (e.g., std::cout).
 
void RC::swap (RStr &lhs, RStr &rhs)
 Swaps two RStr'ings.
 
std::istream & RC::getline (std::istream &is, RStr &str, char delim='\n')
 Sets str equal to one line from the input stream, up to end of file or the delim, which is discarded.
 
bool RC::operator== (const RStr &lhs, const RStr &rhs)
 True if lhs equals rhs.
 
bool RC::operator!= (const RStr &lhs, const RStr &rhs)
 True if lhs does not equal rhs.
 
bool RC::operator< (const RStr &lhs, const RStr &rhs)
 True if lhs is less than rhs.
 
bool RC::operator> (const RStr &lhs, const RStr &rhs)
 True if lhs is greater than rhs.
 
bool RC::operator<= (const RStr &lhs, const RStr &rhs)
 True if lhs is less than or equal to rhs.
 
bool RC::operator>= (const RStr &lhs, const RStr &rhs)
 True if lhs is greater than or equal to rhs.
 
const RStr RC::REG_FLT ("[-+]?[0-9]*\\.?[0-9]+[eE][-+]?[0-9]+|[-+]?[0-9]*\\.?[0-9]+")
 A regular expression component to match a floating point number.
 
const RStr RC::REG_FLTP ("([-+]?[0-9]*\\.?[0-9]+[eE][-+]?[0-9]+|[-+]?[0-9]*\\.?[0-9]+)")
 A regular expression component to match and return a floating point number.
 

Detailed Description

Provides a robust value-added wrapper for std::string.

Macro Definition Documentation

◆ RC_RSTR_Float_Input

#define RC_RSTR_Float_Input (   TYPE)
Value:
/** \brief Formats x as a string in the given style, and with it rounded
to precision digits.
\details For SCI precision is the significant digits to show, for
AUTO it is the most signicant digits to show before removing trailing
zeroes, and for FIXED, precision is digits after the decimal. AUTO
has no exponent for numbers in the range (1e-5, 10^Precision). */ \
inline RStr(TYPE x, RStr_FloatStyle style=AUTO, \
u32 precision=std::numeric_limits<TYPE>::digits10) { \
ParseFloat(x, style, precision); \
}
uint32_t u32
32-bit unsigned integer.
Definition: Types.h:29
RStr_FloatStyle
The styles in which a floating point number can be formatted.
Definition: RStr.h:74

Internal.

◆ RC_RSTR_Int_Input

#define RC_RSTR_Int_Input (   TYPE)
Value:
/** \brief Formats x as a string in the given style, and with at least \
precision 0-padded digits. */ \
inline RStr(TYPE x, RStr_IntStyle style=DEC, i32 precision=-1) { \
ParseInt(x, style, precision); \
}
int32_t i32
32-bit signed integer.
Definition: Types.h:28
RStr_IntStyle
The styles in which an integral number can be formatted.
Definition: RStr.h:64

Internal.

email address
— (c) 2015