AXCEL C++ Framework
Elegance through abstraction
|
Everything. More...
Namespaces | |
namespace | color |
namespace | fs |
File system. | |
namespace | io |
Input/Output. | |
namespace | net |
Network and protocols. | |
namespace | proc |
Process and runtime. | |
Classes | |
class | object |
Common base class. More... | |
class | data |
File-like buffer. More... | |
class | string |
String. More... | |
class | timer |
Time keeper. More... | |
class | console |
Console I/O and manipulation. More... | |
struct | errno_str |
class | exception |
Exception class. More... | |
Functions | |
char * | strcpy2 (char *s1, const char *s2) |
char * | strncpy2 (char *s1, const char *s2, size_t n) |
void | die (const char *format,...) |
Print formatted string and exit. | |
unsigned short | cksum (const char *buf) |
string checksum | |
int | rand (int min=0, int max=0) |
Get random integer. | |
int | rands (unsigned int seed, int min=0, int max=0) |
Get random integer. | |
char * | memrev (char *s, size_t size, size_t n) |
Reverse memory block. | |
char * | memrol (char *s, size_t size, size_t n) |
Rotate left memory block. | |
char * | memror (char *s, size_t size, size_t n) |
Rotate right memory block. | |
char * | memshr (char *s, size_t size, size_t n) |
Shift right memory block. | |
char * | memshl (char *s, size_t size, size_t n) |
Shift left memory block. | |
string | chop (const char *str) |
Remove last character from string. | |
string | chomp (const char *str, const char *eat="\r\n") |
Remove existing string from end of string. | |
string | cut (const char *str) |
Remove first character from string. | |
string | munch (const char *str, const char *eat) |
Remove existing string from beginning of string. | |
string | ltrim (const char *str) |
Remove leading whitespace. | |
string | rtrim (const char *str) |
Remove trailing whitespace. | |
string | strip (const char *str) |
Remove leading and trailing whitespace. | |
string | substr (const char *str, size_t offset, size_t length) |
Get substring. | |
string | lc (const char *str) |
Lowercase string. | |
string | lcfirst (const char *str) |
Lowercase first character. | |
string | uc (const char *str) |
Uppercase string. | |
string | ucfirst (const char *str) |
Uppercase first character. | |
long | rindex (const char *str, const char *find) |
Find last string. | |
long | rindex (const char *str, int find) |
Find last character. | |
string | q (const char *str) |
Single quote string. | |
string | qq (const char *str) |
Double quote string. | |
string | qx (const char *exec) |
Execute command and return io::output. | |
string | scat (const char *s1, const char *s2) |
Concatenate strings. | |
string | sdup (const char *str, int x) |
Duplicate string. | |
string | tok (size_t index, const char *str, const char *delim=" ") |
Extract token from string. | |
string | tok (size_t index, const char *str, int delim) |
Extract token from string. | |
long | ntok (const char *str, const char *delim=" ") |
Count string tokens. | |
long | ntok (const char *str, int delim) |
Count string tokens. | |
long | itok (size_t index, const char *str, const char *delim=" ") |
Get index of token. | |
long | itok (size_t index, const char *str, int delim) |
Get index of token. | |
std::deque< axcel::string > | split (const char *str, const char *delim) |
Split string. | |
std::deque< axcel::string > | split (const char *str, int delim) |
Split string. | |
string | join (std::deque< axcel::string > v, const char *delim=" ") |
Join string deque. | |
string | join (std::deque< axcel::string > v, int delim) |
Join string deque. | |
time_t | axcel_timegm (struct tm *tm) |
const char * | strstrs (const char *src,...) |
int | strstrc (const char *src,...) |
template<typename type > | |
type | stoi (const char *s, int base=10) |
string to integer | |
template<typename type > | |
type | stof (const char *s) |
string to floating point | |
template<typename type > | |
string | itos (type t, int base=10, bool showbase=false) |
Integer to string. | |
template<typename type > | |
string | ftos (type t, bool sci=false) |
Floating-point to string. | |
void | print (const char *s, FILE *stream=stdout) |
Print string. | |
void | print (int ch, FILE *stream=stdout) |
Print character. | |
long | index (const char *str, const char *find) |
Find first string. | |
long | index (const char *str, int find) |
Find first character. | |
long | length (const char *str) |
Length of string. | |
bool | eq (const char *s1, const char *s2) |
Compare strings. | |
bool | sfront (const char *s1, const char *s2) |
Compare beginning of string. | |
bool | sback (const char *s1, const char *s2) |
Compare end of string. | |
long | dec (const char *str) |
string to decimal long int | |
long | bin (const char *str) |
string to binary long int | |
long | oct (const char *str) |
string to octal long int | |
long | hex (const char *str) |
string to hexadecimal long int | |
Variables | |
struct errno_str | errno_strs [] |
console | con |
Everything.
long axcel::bin | ( | const char * | str | ) | [inline] |
string axcel::chomp | ( | const char * | str, |
const char * | eat = "\r\n" |
||
) |
string axcel::chop | ( | const char * | str | ) |
unsigned short axcel::cksum | ( | const char * | buf | ) |
string axcel::cut | ( | const char * | str | ) |
long axcel::dec | ( | const char * | str | ) | [inline] |
void axcel::die | ( | const char * | format, |
... | |||
) |
bool axcel::eq | ( | const char * | s1, |
const char * | s2 | ||
) | [inline] |
string axcel::ftos | ( | type | t, |
bool | sci = false |
||
) |
long axcel::hex | ( | const char * | str | ) | [inline] |
long axcel::index | ( | const char * | str, |
const char * | find | ||
) | [inline] |
long axcel::index | ( | const char * | str, |
int | find | ||
) | [inline] |
long axcel::itok | ( | size_t | index, |
const char * | str, | ||
const char * | delim = " " |
||
) |
long axcel::itok | ( | size_t | index, |
const char * | str, | ||
int | delim | ||
) |
string axcel::itos | ( | type | t, |
int | base = 10 , |
||
bool | showbase = false |
||
) |
Integer to string.
t | Constant value of numeric template type to convert |
base | Numeric base |
showbase | Prefix base prefix (default false) |
Converts template type t to a string representing it's value. Valid templates for this function are the same for the stoi function. Valid values for the base parameter are 16, 10, and 8. If showbase is set to true then the string will be prefixed with "0x" if it's base 16, "0" if it's base 8, and no prefix for base 10.
string axcel::join | ( | std::deque< axcel::string > | v, |
const char * | delim = " " |
||
) |
string axcel::join | ( | std::deque< axcel::string > | v, |
int | delim | ||
) |
string axcel::lc | ( | const char * | str | ) |
string axcel::lcfirst | ( | const char * | str | ) |
long axcel::length | ( | const char * | str | ) | [inline] |
string axcel::ltrim | ( | const char * | str | ) |
char * axcel::memrev | ( | char * | s, |
size_t | size, | ||
size_t | n | ||
) |
char * axcel::memrol | ( | char * | s, |
size_t | size, | ||
size_t | n | ||
) |
char * axcel::memror | ( | char * | s, |
size_t | size, | ||
size_t | n | ||
) |
char * axcel::memshl | ( | char * | s, |
size_t | size, | ||
size_t | n | ||
) |
char * axcel::memshr | ( | char * | s, |
size_t | size, | ||
size_t | n | ||
) |
string axcel::munch | ( | const char * | str, |
const char * | eat | ||
) |
long axcel::ntok | ( | const char * | str, |
const char * | delim = " " |
||
) |
long axcel::ntok | ( | const char * | str, |
int | delim | ||
) |
long axcel::oct | ( | const char * | str | ) | [inline] |
void axcel::print | ( | int | ch, |
FILE * | stream = stdout |
||
) | [inline] |
void axcel::print | ( | const char * | s, |
FILE * | stream = stdout |
||
) | [inline] |
string axcel::q | ( | const char * | str | ) |
string axcel::qq | ( | const char * | str | ) |
string axcel::qx | ( | const char * | exec | ) |
Execute command and return io::output.
exec | The system shell command |
int axcel::rand | ( | int | min = 0 , |
int | max = 0 |
||
) |
int axcel::rands | ( | unsigned int | seed, |
int | min = 0 , |
||
int | max = 0 |
||
) |
long axcel::rindex | ( | const char * | str, |
int | find | ||
) |
long axcel::rindex | ( | const char * | str, |
const char * | find | ||
) |
string axcel::rtrim | ( | const char * | str | ) |
bool axcel::sback | ( | const char * | s1, |
const char * | s2 | ||
) | [inline] |
string axcel::scat | ( | const char * | s1, |
const char * | s2 | ||
) |
string axcel::sdup | ( | const char * | str, |
int | x | ||
) |
bool axcel::sfront | ( | const char * | s1, |
const char * | s2 | ||
) | [inline] |
std::deque< axcel::string > axcel::split | ( | const char * | str, |
const char * | delim | ||
) |
std::deque< axcel::string > axcel::split | ( | const char * | str, |
int | delim | ||
) |
type axcel::stof | ( | const char * | s | ) |
string to floating point
s | The string |
Converts the initial portion of the string to the floating point template type. Valid template types are: float, double, and long double. The number represented in the string must be base 10. If an error occurs this function returns 0.
type axcel::stoi | ( | const char * | s, |
int | base = 10 |
||
) |
string to integer
s | The string |
base | Numeric base |
Converts the initial portion of the string to the numeric template type. Valid template types are: char, short, int, long, long long, and their unsigned equivalents. base specifies the numeric base to use. If base is 0, then the integer is read in base 16 if it begins with 0x, in base 8 if it begins with 0, and in base 10 otherwise. If there was an error this function returns 0.
string axcel::strip | ( | const char * | str | ) |
char* axcel::strncpy2 | ( | char * | s1, |
const char * | s2, | ||
size_t | n | ||
) |
string axcel::substr | ( | const char * | str, |
size_t | offset, | ||
size_t | length | ||
) |
string axcel::tok | ( | size_t | index, |
const char * | str, | ||
int | delim | ||
) |
string axcel::tok | ( | size_t | index, |
const char * | str, | ||
const char * | delim = " " |
||
) |
string axcel::uc | ( | const char * | str | ) |
string axcel::ucfirst | ( | const char * | str | ) |
struct errno_str axcel::errno_strs |