Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions
cube_tools.hpp File Reference
#include <algorithm>
#include <cassert>
#include <cstring>

Go to the source code of this file.

Classes

struct  isclass< T >
 Check if a given type is a class. More...
 
struct  stringslice
 

Macros

#define ASSERT(c)   if(c) {}
 
#define RESTRICT
 
#define UNUSED
 
#define DELETEP(p)   if(p) { delete p; p = 0; }
 Delete Pointer, Wrapper around delete, sets pointer to NULL afterwards(!). More...
 
#define DELETEA(p)   if(p) { delete[] p; p = 0; }
 Delete Array, Wrapper around delete[], sets pointer to NULL afterwards(!). More...
 
#define __cdecl
 
#define _vsnprintf   vsnprintf
 

Functions

char * copystring (char *d, const char *s, size_t len)
 
template<size_t N>
char * copystring (char(&d)[N], const char *s)
 
template<size_t N>
bool matchstring (const char *s, size_t len, const char(&d)[N])
 Compare c-strings using memcmp. More...
 
char * newstring (size_t l)
 
char * newstring (const char *s, size_t l)
 
char * newstring (const char *s)
 
char * newstring (const stringslice &s)
 
const char * stringptr (const char *s)
 
const char * stringptr (const stringslice &s)
 
int stringlen (const char *s)
 
int stringlen (const stringslice &s)
 
char * copystring (char *d, const stringslice &s, size_t len)
 
template<size_t N>
char * copystring (char(&d)[N], const stringslice &s)
 

Macro Definition Documentation

#define __cdecl
#define _vsnprintf   vsnprintf

Referenced by stream::printf(), and vformatstring().

#define ASSERT (   c)    if(c) {}
#define DELETEA (   p)    if(p) { delete[] p; p = 0; }

Delete Array, Wrapper around delete[], sets pointer to NULL afterwards(!).

Referenced by autograss(), md5::md5mesh::cleanup(), blobrenderer::cleanup(), Shader::cleanup(), server::worldstate::cleanup(), recorder::soundbuffer::cleanup(), recorder::videobuffer::cleanup(), skelmodel::skeleton::cleanup(), skelmodel::skelmeshgroup::cleanup(), cleanuptexture(), clear_command(), gzstream::close(), complete(), defershader(), discardchildren(), Shader::force(), vertmodel::vertmeshgroup::genvbo(), skelmodel::skelmeshgroup::genvbo(), gl_drawhud(), sphere::init(), decalrenderer::init(), blobrenderer::init(), fogdome::init(), varenderer< T >::init(), recorder::videobuffer::init(), skelmodel::skelpart::initanimparts(), inputcommand(), keymap(), recorder::soundbuffer::load(), lockpvs_(), newgui(), newshader(), reloadtex(), renderbackground(), Slot::reset(), hline::restore(), editor::setfile(), blobrenderer::~blobrenderer(), skelmodel::boneinfo::~boneinfo(), decalrenderer::~decalrenderer(), delayedupdate::~delayedupdate(), editor::~editor(), filesval::~filesval(), hline::~hline(), keym::~keym(), animmodel::mesh::~mesh(), animmodel::meshgroup::~meshgroup(), animmodel::part::~part(), prefab::~prefab(), Shader::~Shader(), skelmodel::skelanimspec::~skelanimspec(), skelmodel::skeleton::~skeleton(), skelmodel::skelmesh::~skelmesh(), skelmodel::skelmeshgroup::~skelmeshgroup(), skelmodel::skelpart::~skelpart(), inexor::sound::soundsample::~soundsample(), vertmodel::tag::~tag(), skelmodel::tag::~tag(), vertmodel::vertmesh::~vertmesh(), and vertmodel::vertmeshgroup::~vertmeshgroup().

#define DELETEP (   p)    if(p) { delete p; p = 0; }
#define RESTRICT
#define UNUSED

Referenced by main().

Function Documentation

char* copystring ( char *  d,
const char *  s,
size_t  len 
)
inline
template<size_t N>
char* copystring ( char(&)  d[N],
const char *  s 
)
inline

References copystring(), and hmap::d.

char* copystring ( char *  d,
const stringslice s,
size_t  len 
)
inline
template<size_t N>
char* copystring ( char(&)  d[N],
const stringslice s 
)
inline

References copystring(), and hmap::d.

template<size_t N>
bool matchstring ( const char *  s,
size_t  len,
const char(&)  d[N] 
)
inline

Compare c-strings using memcmp.

References hmap::d.

Referenced by texturedata().

char* newstring ( size_t  l)
inline
char* newstring ( const char *  s,
size_t  l 
)
inline

References copystring(), and newstring().

char* newstring ( const char *  s)
inline

References hmap::d, and newstring().

char* newstring ( const stringslice s)
inline
int stringlen ( const char *  s)
inline
int stringlen ( const stringslice s)
inline

References stringslice::len.

const char* stringptr ( const char *  s)
inline
const char* stringptr ( const stringslice s)
inline

References stringslice::str.