AXCEL C++ Framework
Elegance through abstraction
Namespaces | Functions | Variables
axcel.cpp File Reference
#include "axcel.h"

Go to the source code of this file.

Namespaces

namespace  axcel
 

Everything.


namespace  axcel::fs
 

File system.


namespace  axcel::proc
 

Process and runtime.


namespace  axcel::net
 

Network and protocols.


namespace  axcel::net::irc
 

Internet Relay Chat.


namespace  axcel::net::http
 

Hyper Text Transfer Protocol.


Functions

char * axcel::strcpy2 (char *s1, const char *s2)
char * axcel::strncpy2 (char *s1, const char *s2, size_t n)
void axcel::die (const char *format,...)
 Print formatted string and exit.
unsigned short axcel::cksum (const char *buf)
 string checksum
int axcel::rand (int min=0, int max=0)
 Get random integer.
int axcel::rands (unsigned int seed, int min=0, int max=0)
 Get random integer.
char * axcel::memrev (char *s, size_t size, size_t n)
 Reverse memory block.
char * axcel::memrol (char *s, size_t size, size_t n)
 Rotate left memory block.
char * axcel::memror (char *s, size_t size, size_t n)
 Rotate right memory block.
char * axcel::memshr (char *s, size_t size, size_t n)
 Shift right memory block.
char * axcel::memshl (char *s, size_t size, size_t n)
 Shift left memory block.
string axcel::chop (const char *str)
 Remove last character from string.
string axcel::chomp (const char *str, const char *eat="\r\n")
 Remove existing string from end of string.
string axcel::cut (const char *str)
 Remove first character from string.
string axcel::munch (const char *str, const char *eat)
 Remove existing string from beginning of string.
string axcel::ltrim (const char *str)
 Remove leading whitespace.
string axcel::rtrim (const char *str)
 Remove trailing whitespace.
string axcel::strip (const char *str)
 Remove leading and trailing whitespace.
string axcel::substr (const char *str, size_t offset, size_t length)
 Get substring.
string axcel::lc (const char *str)
 Lowercase string.
string axcel::lcfirst (const char *str)
 Lowercase first character.
string axcel::uc (const char *str)
 Uppercase string.
string axcel::ucfirst (const char *str)
 Uppercase first character.
long axcel::rindex (const char *str, const char *find)
 Find last string.
long axcel::rindex (const char *str, int find)
 Find last character.
string axcel::q (const char *str)
 Single quote string.
string axcel::qq (const char *str)
 Double quote string.
string axcel::qx (const char *exec)
 Execute command and return io::output.
string axcel::scat (const char *s1, const char *s2)
 Concatenate strings.
string axcel::sdup (const char *str, int x)
 Duplicate string.
string axcel::tok (size_t index, const char *str, const char *delim=" ")
 Extract token from string.
string axcel::tok (size_t index, const char *str, int delim)
 Extract token from string.
long axcel::ntok (const char *str, const char *delim=" ")
 Count string tokens.
long axcel::ntok (const char *str, int delim)
 Count string tokens.
long axcel::itok (size_t index, const char *str, const char *delim=" ")
 Get index of token.
long axcel::itok (size_t index, const char *str, int delim)
 Get index of token.
std::deque< axcel::stringaxcel::split (const char *str, const char *delim)
 Split string.
std::deque< axcel::stringaxcel::split (const char *str, int delim)
 Split string.
string axcel::join (std::deque< axcel::string > v, const char *delim=" ")
 Join string deque.
string axcel::join (std::deque< axcel::string > v, int delim)
 Join string deque.
time_t axcel::axcel_timegm (struct tm *tm)
const char * axcel::strstrs (const char *src,...)
int axcel::strstrc (const char *src,...)
timer axcel::fs::fatime (const char *fname)
 Get file access time.
timer axcel::fs::fmtime (const char *fname)
 Get file modification time.
bool axcel::fs::mv (const char *src, const char *dst)
 Move file.
bool axcel::fs::cp (const char *src, const char *dst)
 Copy file.
string axcel::fs::gcd ()
 Get current directory.
string axcel::fs::ls (const char *dir=0)
 List files.
size_t axcel::fs::fread (const char *fname, char *buf, size_t len=0)
 Read from file.
string axcel::fs::fread (const char *fname, size_t len=0)
 Read from text file.
size_t axcel::fs::fwrite (const char *fname, const char *buf, size_t len=0)
 Write to file.
size_t axcel::fs::fcat (const char *fname, const char *buf, size_t len=0)
 Concatenate to file.
bool axcel::fs::fcmp (const char *src, const char *dst)
 Compare files.
bool axcel::fs::md (const char *path)
 Make directory.
bool axcel::fs::cd (const char *path)
 Change current directory.
bool axcel::fs::creat (const char *fname)
 Create file.
bool axcel::fs::trunc (const char *fname, unsigned long len)
 Resize file.
bool axcel::fs::rm (const char *fname)
 Remove file.
bool axcel::fs::rd (const char *dir, bool rmsub=1)
 Remove directory.
size_t axcel::fs::fsize (const char *fname)
 Get file size.
bool axcel::fs::fexist (const char *fname)
 Check if file exists.
bool axcel::fs::fisdir (const char *fname)
 Check if file is directory.
bool axcel::fs::fisreg (const char *fname)
 Check if file is regular file.
string axcel::proc::lsproc ()
 List processes.
pid_t axcel::proc::run (const char *program, const char *argv, void *envp)
 Spawn new process.
bool axcel::proc::killp (size_t pid)
 Kill process.
bool axcel::proc::killp (const char *name)
 Kill process.
bool axcel::proc::freeze (size_t pid)
 Suspend process.
bool axcel::proc::freeze (const char *name)
 Suspend process.
bool axcel::proc::cont (size_t pid)
 Resume process.
bool axcel::proc::cont (const char *name)
 Resume process.
void axcel::proc::delay (size_t ms)
 Sleep current thread.
bool axcel::proc::envset (const char *name, const char *value)
 Set environment variable.
string axcel::proc::envget (const char *name)
 Get environment variable.

Variables

struct errno_str axcel::errno_strs []
console axcel::con

Detailed Description

Definition in file axcel.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerator Defines