26 #error C++ is required 
   30 #include <sys/types.h> 
   37 #if defined(__arch64__) || defined(__x86_64__) \ 
   38     || defined(__amd64__) || defined(__ia64__) \ 
   39     || defined(__alpha__) || defined(__sparcv9) || defined(__mips64) 
   47 #if defined(WIN32) || defined(_WIN32) 
   61 typedef signed __int8 int8_t;
 
   62 typedef unsigned __int8 u_int8_t;
 
   63 typedef unsigned __int8 uint8_t;
 
   64 typedef signed __int16 int16_t;
 
   65 typedef unsigned __int16 u_int16_t;
 
   66 typedef unsigned __int16 uint16_t;
 
   67 typedef signed __int32 int32_t;
 
   68 typedef unsigned __int32 u_int32_t;
 
   69 typedef unsigned __int32 uint32_t;
 
   70 typedef signed __int64 int64_t;
 
   71 typedef unsigned __int64 u_int64_t;
 
   72 typedef unsigned __int64 uint64_t;
 
   75 typedef int socklen_t;
 
   76 typedef unsigned long in_addr_t;
 
   79 #define strcasecmp _stricmp 
   83 #define strncasecmp _strnicmp 
   86 #define vsnprintf _vsnprintf 
   87 #define snprintf _snprintf 
   88 #define strdup _strdup 
   89 #define strtoll _strtoi64 
   95 #define getpid _getpid 
   97 #define mkdir(p,m) _mkdir(p) 
   98 #define unlink _unlink 
  100 #define O_RDWR   _O_RDWR 
  101 #define O_RDONLY _O_RDONLY 
  102 #define O_WRONLY _O_WRONLY 
  103 #define O_APPEND _O_APPEND 
  104 #define O_BINARY _O_BINARY 
  105 #define O_EXCL   _O_EXCL 
  106 #define O_CREAT  _O_CREAT 
  107 #define O_TRUNC  _O_TRUNC 
  110 #define S_IRUSR _S_IREAD 
  111 #define S_IWUSR _S_IWRITE 
  113 #define S_IRWXU (_S_IREAD|_S_IWRITE) 
  115 #ifdef LIBYATE_EXPORTS 
  116 #define YATE_API __declspec(dllexport) 
  118 #ifndef LIBYATE_STATIC 
  119 #define YATE_API __declspec(dllimport) 
  123 #define FMT64 "%I64d" 
  124 #define FMT64U "%I64u" 
  128 #include <sys/time.h> 
  129 #include <sys/socket.h> 
  131 #if defined(__FreeBSD__) 
  132 #include <netinet/in_systm.h> 
  135 #include <netinet/in.h> 
  136 #include <netinet/ip.h> 
  137 #include <netinet/tcp.h> 
  138 #include <arpa/inet.h> 
  155 #if _WORDSIZE == 64 && !defined(__APPLE__) 
  160 #define FMT64U "%llu" 
  167 #define LLONG_MAX _I64_MAX 
  169 #define LLONG_MAX 9223372036854775807LL 
  175 #define LLONG_MIN _I64_MIN 
  177 #define LLONG_MIN (-LLONG_MAX - 1LL) 
  183 #define ULLONG_MAX _UI64_MAX 
  185 #define ULLONG_MAX 18446744073709551615ULL 
  190 #define O_LARGEFILE 0 
  193 #ifndef IPTOS_LOWDELAY 
  194 #define IPTOS_LOWDELAY      0x10 
  195 #define IPTOS_THROUGHPUT    0x08 
  196 #define IPTOS_RELIABILITY   0x04 
  198 #ifndef IPTOS_MINCOST 
  199 #define IPTOS_MINCOST       0x02 
  202 #define IPPROTO_SCTP        132 
  211 #define RAND_MAX 2147483647 
  219 #ifdef HAVE_GCC_FORMAT_CHECK 
  220 #define FORMAT_CHECK(f) __attribute__((format(printf,(f),(f)+1))) 
  222 #define FORMAT_CHECK(f) 
  225 #define YIGNORE(v) while (v) { break; } 
  227 #ifdef HAVE_BLOCK_RETURN 
  228 #define YSTRING(s) (*({static const String str("" s);&str;})) 
  229 #define YATOM(s) (*({static const String* str(0);str ? str : String::atom(str,"" s);})) 
  231 #define YSTRING(s) ("" s) 
  232 #define YATOM(s) ("" s) 
  235 #define YSTRING_INIT_HASH ((unsigned) -1) 
  258     DebugGoOn = DebugCrit,
 
  287 YATE_API 
bool debugAt(
int level);
 
  318         : m_level(DebugFail), m_enabled(enabled), m_chain(0), m_name(0)
 
  322         { m_name = 0; m_chain = 0; }
 
  329         { 
return m_chain ? m_chain->debugLevel() : m_level; }
 
  343         { 
return m_chain ? m_chain->debugEnabled() : m_enabled; }
 
  350         { m_enabled = enable; m_chain = 0; }
 
  371         { 
return m_chain != 0; }
 
  378         { m_chain = (chain != 
this) ? chain : 0; }
 
  407 void DDebug(
int level, 
const char* format, ...);
 
  414 void DDebug(
const char* facility, 
int level, 
const char* format, ...);
 
  421 void DDebug(
const DebugEnabler* local, 
int level, 
const char* format, ...);
 
  428 void XDebug(
int level, 
const char* format, ...);
 
  435 void XDebug(
const char* facility, 
int level, 
const char* format, ...);
 
  442 void XDebug(
const DebugEnabler* local, 
int level, 
const char* format, ...);
 
  449 void NDebug(
int level, 
const char* format, ...);
 
  456 void NDebug(
const char* facility, 
int level, 
const char* format, ...);
 
  463 void NDebug(
const DebugEnabler* local, 
int level, 
const char* format, ...);
 
  466 #if defined(_DEBUG) || defined(DEBUG) || defined(XDEBUG) 
  475 #define DDebug do { break; } while 
  477 #define DDebug(arg...) 
  485 #define XDebug do { break; } while 
  487 #define XDebug(arg...) 
  495 #define NDebug do { break; } while 
  497 #define NDebug(arg...) 
  506 YATE_API 
void Debug(
int level, 
const char* format, ...) FORMAT_CHECK(2);
 
  514 YATE_API 
void Debug(const 
char* facility, 
int level, const 
char* format, ...) FORMAT_CHECK(3);
 
  522 YATE_API 
void Debug(const DebugEnabler* local, 
int level, const 
char* format, ...) FORMAT_CHECK(3);
 
  530 YATE_API 
void Alarm(const 
char* component, 
int level, const 
char* format, ...) FORMAT_CHECK(3);
 
  538 YATE_API 
void Alarm(const DebugEnabler* component, 
int level, const 
char* format, ...) FORMAT_CHECK(3);
 
  547 YATE_API 
void Alarm(const 
char* component, const 
char* info, 
int level, const 
char* format, ...) FORMAT_CHECK(4);
 
  556 YATE_API 
void Alarm(const DebugEnabler* component, const 
char* info, 
int level, const 
char* format, ...) FORMAT_CHECK(4);
 
  562 YATE_API 
void Output(const 
char* format, ...) FORMAT_CHECK(1);
 
  591     explicit Debugger(
const char* name, 
const char* format = 0, ...);
 
  599     Debugger(
int level, 
const char* name, 
const char* format = 0, ...);
 
  610     static void setOutput(
void (*outFunc)(
const char*,
int) = 0);
 
  616     static void setIntOut(
void (*outFunc)(
const char*,
int) = 0);
 
  622     static void setAlarmHook(
void (*alarmFunc)(
const char*,
int,
const char*,
const char*) = 0);
 
  628     static void setRelayHook(
void (*relayFunc)(
int,
const char*,
const char*,
const char*) = 0);
 
  635     static void enableOutput(
bool enable = 
true, 
bool colorize = 
false);
 
  641     static uint32_t getStartTimeSec();
 
  647     static Formatting getFormatting();
 
  654     static void setFormatting(Formatting format, uint32_t startTimeSec = 0);
 
  662     static unsigned int formatTime(
char* buf, Formatting format = getFormatting());
 
  672     static void relayOutput(
int level, 
char* buffer, 
const char* component = 0, 
const char* info = 0);
 
  730 constant 
YSTRING(
const char* 
string);
 
  737 constant 
YATOM(
const char* 
string);
 
  744 void YCLASS(
class type,
class base);
 
  752 void YCLASS2(
class type,
class base1,
class base2);
 
  761 void YCLASS3(
class type,
class base1,
class base2,
class base3);
 
  776 void YCLASSIMP2(
class type,
class base1,
class base2);
 
  785 void YCLASSIMP3(
class type,
class base1,
class base2,
class base3);
 
  802 #define YCLASS(type,base) \ 
  803 public: virtual void* getObject(const String& name) const \ 
  804 { return (name == YATOM(#type)) ? const_cast<type*>(this) : base::getObject(name); } 
  806 #define YCLASS2(type,base1,base2) \ 
  807 public: virtual void* getObject(const String& name) const \ 
  808 { if (name == YATOM(#type)) return const_cast<type*>(this); \ 
  809   void* tmp = base1::getObject(name); \ 
  810   return tmp ? tmp : base2::getObject(name); } 
  812 #define YCLASS3(type,base1,base2,base3) \ 
  813 public: virtual void* getObject(const String& name) const \ 
  814 { if (name == YATOM(#type)) return const_cast<type*>(this); \ 
  815   void* tmp = base1::getObject(name); \ 
  816   if (tmp) return tmp; \ 
  817   tmp = base2::getObject(name); \ 
  818   return tmp ? tmp : base3::getObject(name); } 
  820 #define YCLASSIMP(type,base) \ 
  821 void* type::getObject(const String& name) const \ 
  822 { return (name == YATOM(#type)) ? const_cast<type*>(this) : base::getObject(name); } 
  824 #define YCLASSIMP2(type,base1,base2) \ 
  825 void* type::getObject(const String& name) const \ 
  826 { if (name == YATOM(#type)) return const_cast<type*>(this); \ 
  827   void* tmp = base1::getObject(name); \ 
  828   return tmp ? tmp : base2::getObject(name); } 
  830 #define YCLASSIMP3(type,base1,base2,base3) \ 
  831 void* type::getObject(const String& name) const \ 
  832 { if (name == YATOM(#type)) return const_cast<type*>(this); \ 
  833   void* tmp = base1::getObject(name); \ 
  834   if (tmp) return tmp; \ 
  835   tmp = base2::getObject(name); \ 
  836   return tmp ? tmp : base3::getObject(name); } 
  838 #define YOBJECT(type,pntr) (static_cast<type*>(GenObject::getObject(YATOM(#type),pntr))) 
  840 #define YNOCOPY(type) private: \ 
  842 void operator=(const type&) 
  868     virtual bool alive() 
const;
 
  881     virtual const String& toString() 
const;
 
  888     virtual void* getObject(
const String& name) 
const;
 
  897         { 
return obj ? obj->
getObject(name) : 0; }
 
  904         { 
return s_counting; }
 
  911         { s_counting = enable; }
 
  918         { 
return m_counter; }
 
  939     static ObjList& getObjCounters();
 
  943     static bool s_counting;
 
  961     { 
if (obj) { obj->destruct(); obj = 0; } }
 
  987     virtual void* getObject(
const String& name) 
const;
 
  995     virtual bool alive() 
const;
 
 1018         { 
return m_refcount; }
 
 1032         { 
return obj && (obj->
refcount() > 0); }
 
 1039     static bool efficientIncDec();
 
 1047     virtual void zeroRefs();
 
 1061     virtual void destroyed();
 
 1107         { 
return static_cast<Obj*
>(
m_pointer); }
 
 1154         { 
assign(
object); 
return *
this; }
 
 1160     inline operator Obj*() 
const 
 1215         { m_pointer = value; 
return *
this; }
 
 1221         { m_pointer = object; 
return *
this; }
 
 1227     inline operator Obj*() 
const 
 1228         { 
return m_pointer; }
 
 1234         { 
return m_pointer; }
 
 1240         { 
return *m_pointer; }
 
 1266     virtual void* getObject(
const String& name) 
const;
 
 1272     unsigned int length() 
const;
 
 1278     unsigned int count() 
const;
 
 1340         { 
return at(index); }
 
 1348         { 
return at(index); }
 
 1383     int index(
const String& str) 
const;
 
 1447         { 
return m_delete; }
 
 1454         { m_delete = autodelete; }
 
 1460     static const ObjList& empty();
 
 1474     void sort(
int (*callbackCompare)(
GenObject* obj1, 
GenObject* obj2, 
void* context), 
void* context = 0);
 
 1494         : m_length(0), m_objects(0), m_delete(autodelete)
 
 1502     ObjVector(
unsigned int maxLen, 
bool autodelete = 
true);
 
 1511     ObjVector(
ObjList& list, 
bool move = 
true, 
unsigned int maxLen = 0, 
bool autodelete = 
true);
 
 1523     virtual void* getObject(
const String& name) 
const;
 
 1530         { 
return m_length; }
 
 1536     unsigned int count() 
const;
 
 1550         { 
return (index >= 0 && index < (
int)m_length) ? m_objects[index] : 0; }
 
 1558         { 
return at(index); }
 
 1566         { 
return at(index); }
 
 1575     unsigned int assign(
ObjList& list, 
bool move = 
true, 
unsigned int maxLen = 0);
 
 1590     bool set(
GenObject* obj, 
unsigned int index);
 
 1604     int index(
const String& str) 
const;
 
 1616         { 
return m_delete; }
 
 1623         { m_delete = autodelete; }
 
 1626     unsigned int m_length;
 
 1647     explicit Array(
int columns = 0, 
int rows = 0);
 
 1659     virtual void* getObject(
const String& name) 
const;
 
 1667     bool addRow(
ObjList* row = 0, 
int index = -1);
 
 1675     bool addColumn(
ObjList* column = 0, 
int index = -1);
 
 1682     bool delRow(
int index);
 
 1689     bool delColumn(
int index);
 
 1697     GenObject* 
get(
int column, 
int row) 
const;
 
 1714     bool set(
GenObject* obj, 
int column, 
int row);
 
 1728         { 
return m_columns; }
 
 1738             if (column >= 0 || column < m_columns)
 
 1739                 return static_cast<ObjList*
>(m_obj[column]);
 
 1750 class StringMatchPrivate;
 
 1768     inline explicit UChar(uint32_t code = 0)
 
 1777         : m_chr((code < 0) ? 0 : code)
 
 1785         : m_chr((unsigned char)code)
 
 1792     inline explicit UChar(
unsigned char code)
 
 1802         { m_chr = code; encode(); 
return *
this; }
 
 1810         { m_chr = (
unsigned char)code; encode(); 
return *
this; }
 
 1830     inline operator const char*() 
const 
 1840     bool decode(
const char*& str, uint32_t maxChar = 0x10ffff, 
bool overlong = 
false);
 
 1850     bool decode(uint16_t*& buff, 
unsigned int& len, Endianness order, uint32_t maxChar = 0x10ffff);
 
 1859     bool decode(
DataBlock& buff, Endianness order, uint32_t maxChar = 0x10ffff);
 
 1868     bool encode(uint16_t*& buff, 
unsigned int& len, Endianness order);
 
 1876     bool encode(
DataBlock& buff, Endianness order);
 
 1888     static bool decode(
String& out, uint16_t*& buff, 
unsigned int& len, Endianness order, 
bool checkBOM = 
false, uint32_t maxChar = 0x10ffff);
 
 1898     static bool encode(
DataBlock& out, 
const char*& str, Endianness order, 
bool addBOM = 
false);
 
 1909     static bool encode(uint16_t*& buff, 
unsigned int& len, 
const char*& str, Endianness order, 
bool addBOM = 
false);
 
 1943     String(
const char* value, 
int len = -1);
 
 1950     explicit String(
char value, 
unsigned int repeat = 1);
 
 1956     explicit String(int32_t value);
 
 1962     explicit String(uint32_t value);
 
 1968     explicit String(int64_t value);
 
 1974     explicit String(uint64_t value);
 
 1980     explicit String(
bool value);
 
 1986     explicit String(
double value);
 
 2010     virtual void* getObject(
const String& name) 
const;
 
 2016     static const String& empty();
 
 2024         { 
return value ? 
"true" : 
"false"; }
 
 2031         { 
return m_string; }
 
 2038         { 
return m_string ? m_string : 
""; }
 
 2045     inline const char* 
safe(
const char* defStr)
 const 
 2046         { 
return m_string ? m_string : (defStr ? defStr : 
""); }
 
 2053         { 
return m_length; }
 
 2060         { 
return !m_string; }
 
 2069     static int lenUtf8(
const char* value, uint32_t maxChar = 0x10ffff, 
bool overlong = 
false);
 
 2077     inline int lenUtf8(uint32_t maxChar = 0x10ffff, 
bool overlong = 
false)
 const 
 2078         { 
return lenUtf8(m_string,maxChar,overlong); }
 
 2088     int fixUtf8(
const char* replace = 0, uint32_t maxChar = 0x10ffff, 
bool overlong = 
false);
 
 2095     unsigned int encodeFlags(
const TokenDict* tokens) 
const;
 
 2102     uint64_t encodeFlags(
const TokenDict64* tokens) 
const;
 
 2111     const String& decodeFlags(
unsigned int flags, 
const TokenDict* tokens, 
bool unknownflag = 
true);
 
 2120      const String& decodeFlags(uint64_t flags, 
const TokenDict64* tokens, 
bool unknownflag = 
true);
 
 2127         { 
return str && (str[0] == 
'\357') && (str[1] == 
'\273') && (str[2] == 
'\277'); }
 
 2134         { 
return checkBOM(
c_str()); }
 
 2142         { 
return checkBOM(str) && (str += 3); }
 
 2150         { 
return checkBOM(str) && (str += 3); }
 
 2157         { 
return checkBOM(
c_str()) && &(*
this = 
c_str() + 3); }
 
 2165             if (m_hash == YSTRING_INIT_HASH)
 
 2166                 m_hash = hash(m_string);
 
 2176     static unsigned int hash(
const char* value, 
unsigned int h = 0);
 
 2188     char at(
int index) 
const;
 
 2196     String substr(
int offs, 
int len = -1) 
const;
 
 2213     virtual const String& toString() 
const;
 
 2225     int toInteger(
int defvalue = 0, 
int base = 0, 
int minvalue = INT_MIN,
 
 2226         int maxvalue = INT_MAX, 
bool clamp = 
true) 
const;
 
 2235     int toInteger(
const TokenDict* tokens, 
int defvalue = 0, 
int base = 0) 
const;
 
 2247     long int toLong(
long int defvalue = 0, 
int base = 0, 
long int minvalue = LONG_MIN,
 
 2248         long int maxvalue = LONG_MAX, 
bool clamp = 
true) 
const;
 
 2260     int64_t toInt64(int64_t defvalue = 0, 
int base = 0, int64_t minvalue = LLONG_MIN,
 
 2261         int64_t maxvalue = LLONG_MAX, 
bool clamp = 
true) 
const;
 
 2268     double toDouble(
double defvalue = 0.0) 
const;
 
 2275     bool toBoolean(
bool defvalue = 
false) 
const;
 
 2281     bool isBoolean() 
const;
 
 2301         { 
return at(index); }
 
 2309         { 
return at(index); }
 
 2315     inline operator const char*() 
const 
 2316         { 
return m_string; };
 
 2324     String& assign(
const char* value, 
int len = -1);
 
 2332     String& assign(
char value, 
unsigned int repeat = 1);
 
 2342     String& hexify(
void* data, 
unsigned int len, 
char sep = 0, 
bool upCase = 
false);
 
 2349         { 
return operator=(value.
c_str()); }
 
 2357         { 
return operator=(value ? value->
c_str() : 
""); }
 
 2364     String& operator=(
const char* value);
 
 2370     String& operator=(
char value);
 
 2376     String& operator=(int32_t value);
 
 2382     String& operator=(uint32_t value);
 
 2388     String& operator=(int64_t value);
 
 2394     String& operator=(uint64_t value);
 
 2401         { 
return operator=(boolText(value)); }
 
 2407     String& operator=(
double value);
 
 2415         { 
return append(value,-1); }
 
 2421     String& operator+=(
char value);
 
 2427     String& operator+=(int32_t value);
 
 2433     String& operator+=(uint32_t value);
 
 2439     String& operator+=(int64_t value);
 
 2445     String& operator+=(uint64_t value);
 
 2452         { 
return operator+=(boolText(value)); }
 
 2458     String& operator+=(
double value);
 
 2463     bool operator==(
const char* value) 
const;
 
 2468     bool operator!=(
const char* value) 
const;
 
 2474         { 
return (
this == &value) || ((hash() == value.
hash()) && 
operator==(value.
c_str())); }
 
 2480         { 
return (
this != &value) && ((hash() != value.
hash()) || 
operator!=(value.
c_str())); }
 
 2485     bool operator&=(
const char* value) 
const;
 
 2490     bool operator|=(
const char* value) 
const;
 
 2496         { 
return operator+=(value); }
 
 2502         { 
return operator+=(value); }
 
 2508         { 
return operator+=(value); }
 
 2514         { 
return operator+=(value); }
 
 2520         { 
return operator+=(value); }
 
 2526         { 
return operator+=(value); }
 
 2532         { 
return operator+=(value); }
 
 2538         { 
return operator+=(value); }
 
 2544     String& operator>>(
const char* skip);
 
 2549     String& operator>>(
char& store);
 
 2559     String& operator>>(
int& store);
 
 2564     String& operator>>(
unsigned int& store);
 
 2569     String& operator>>(
bool& store);
 
 2577     String& append(
const char* value, 
int len);
 
 2585     String& append(
const char* value, 
const char* separator = 0, 
bool force = 
false);
 
 2593     String& append(
const ObjList* list, 
const char* separator = 0, 
bool force = 
false);
 
 2602         { 
return append(&list,separator,force); }
 
 2609     String& append(
double value, 
unsigned int decimals = 3);
 
 2616     String& printf(
const char* format, ...) FORMAT_CHECK(2);
 
 2623     String& printf(
unsigned int length, const 
char* format,  ...) FORMAT_CHECK(3);
 
 2633     String& appendFixed(
unsigned int fixedLength, const 
char* str, 
unsigned int len = -1, 
char fill = ' ', 
int align = Left);
 
 2642     inline 
String& appendFixed(
unsigned int fixedLength, const 
String& str, 
char fill = ' ', 
int align = Left)
 
 2643         { 
return appendFixed(fixedLength,str.c_str(),str.length(),fill,align); }
 
 2651     int find(
char what, 
unsigned int offs = 0) 
const;
 
 2659     int find(
const char* what, 
unsigned int offs = 0) 
const;
 
 2666     int rfind(
char what) 
const;
 
 2673     int rfind(
const char* what) 
const;
 
 2682     bool startsWith(
const char* what, 
bool wordBreak = 
false, 
bool caseInsensitive = 
false) 
const;
 
 2691     bool endsWith(
const char* what, 
bool wordBreak = 
false, 
bool caseInsensitive = 
false) 
const;
 
 2704     bool startSkip(
const char* what, 
bool wordBreak = 
true, 
bool caseInsensitive = 
false);
 
 2720     String& extractTo(
const char* sep, 
bool& store);
 
 2729     String& extractTo(
const char* sep, 
int& store, 
int base = 0);
 
 2739     String& extractTo(
const char* sep, 
int& store, 
const TokenDict* tokens, 
int base = 0);
 
 2747     String& extractTo(
const char* sep, 
double& store);
 
 2755         { 
return operator==(value); }
 
 2762     bool matches(
const Regexp& rexp);
 
 2769     int matchOffset(
int index = 0) 
const;
 
 2776     int matchLength(
int index = 0) 
const;
 
 2784         { 
return substr(matchOffset(index),matchLength(index)); }
 
 2797     int matchCount() 
const;
 
 2805     ObjList* split(
char separator, 
bool emptyOK = 
true) 
const;
 
 2813     ObjList* split(
const Regexp& reg, 
bool emptyOK = 
true) 
const;
 
 2821     static String msgEscape(
const char* str, 
char extraEsc = 0);
 
 2829         { 
return msgEscape(
c_str(),extraEsc); }
 
 2838     static String msgUnescape(
const char* str, 
int* errptr = 0, 
char extraEsc = 0);
 
 2847         { 
return msgUnescape(
c_str(),errptr,extraEsc); }
 
 2855     static String sqlEscape(
const char* str, 
char extraEsc = 0);
 
 2863         { 
return sqlEscape(
c_str(),extraEsc); }
 
 2872     static String uriEscape(
const char* str, 
char extraEsc = 0, 
const char* noEsc = 0);
 
 2881     static String uriEscape(
const char* str, 
const char* extraEsc, 
const char* noEsc = 0);
 
 2890         { 
return uriEscape(
c_str(),extraEsc,noEsc); }
 
 2898     static String uriUnescape(
const char* str, 
int* errptr = 0);
 
 2906         { 
return uriUnescape(
c_str(),errptr); }
 
 2914     static const String* atom(
const String*& str, 
const char* val);
 
 2920      virtual void changed();
 
 2923     void clearMatches();
 
 2925     unsigned int m_length;
 
 2927     mutable unsigned int m_hash;
 
 2928     StringMatchPrivate* m_matches;
 
 2937     { 
return str ? str->
c_str() : (
const char*)0; }
 
 2945     { 
return str ? str : 
""; }
 
 2953     { 
return str ? str->
safe() : 
""; }
 
 2961     { 
return !(str && *str); }
 
 2969     { 
return !str || str->
null(); }
 
 2974 YATE_API String 
operator+(
const String& s1, 
const String& s2);
 
 2979 YATE_API String 
operator+(
const String& s1, 
const char* s2);
 
 2984 YATE_API String 
operator+(
const char* s1, 
const String& s2);
 
 2991     { dest = src; 
return dest.
c_str(); }
 
 2998     { dest += src; 
return dest.
c_str(); }
 
 3008 YATE_API 
int lookup(
const char* str, 
const TokenDict* tokens, 
int defvalue = 0, 
int base = 0);
 
 3016 YATE_API 
const char* 
lookup(
int value, 
const TokenDict* tokens, 
const char* defvalue = 0);
 
 3026 YATE_API int64_t 
lookup(
const char* str, 
const TokenDict64* tokens, int64_t defvalue = 0, 
int base = 0);
 
 3034 YATE_API 
const char* 
lookup(int64_t value, 
const TokenDict64* tokens, 
const char* defvalue = 0);
 
 3045 YATE_API 
bool controlReturn(NamedList* params, 
bool ret, 
const char* retVal = 0);
 
 3066     explicit Regexp(
const char* value, 
bool extended = 
false, 
bool insensitive = 
false);
 
 3090         { 
return m_regexp || (m_compile && doCompile()); }
 
 3097     bool matches(
const char* value) 
const;
 
 3112     void setFlags(
bool extended, 
bool insensitive);
 
 3118     bool isExtended() 
const;
 
 3124     bool isCaseInsensitive() 
const;
 
 3130     virtual void changed();
 
 3136     bool doCompile() 
const;
 
 3140     bool matches(
const char* value, StringMatchPrivate* matchlist) 
const;
 
 3141     mutable void* m_regexp;
 
 3142     mutable bool m_compile;
 
 3157     inline explicit Atom(
const char* value)
 
 3194         : 
String(text), m_level(level)
 
 3202         : 
String(original), m_level(original.level())
 
 3218         { 
return s_capturing; }
 
 3225         { 
return s_events; }
 
 3232     inline static void append(
int level, 
const char* text)
 
 3233         { 
if (text && *text) s_events.append(
new CapturedEvent(level,text)); }
 
 3241         { 
return s_events; }
 
 3248         { s_capturing = capture; }
 
 3253     static bool s_capturing;
 
 3269     explicit NamedString(
const char* name, 
const char* value = 0);
 
 3282     virtual const String& toString() 
const;
 
 3289     virtual void* getObject(
const String& name) 
const;
 
 3351         { 
return m_data ? m_data->getObject(name) : 0; }
 
 3364     virtual void* getObject(
const String& name) 
const;
 
 3370     virtual void changed();
 
 3396         { 
return m_enabled; }
 
 3403         { m_enabled = val; }
 
 3445     explicit HashList(
unsigned int size = 17);
 
 3457     virtual void* getObject(
const String& name) 
const;
 
 3470     unsigned int count() 
const;
 
 3479         { 
return (index < m_size) ? m_lists[index] : 0; }
 
 3487         { 
return getList(hash % m_size); }
 
 3495         { 
return getHashList(str.
hash()); }
 
 3552         return n ? n->
remove(delobj) : 0;
 
 3576     unsigned int m_size;
 
 3616         { 
return m_length; }
 
 3628     void assign(
ObjList& list, 
int offset = 0);
 
 3635     void assign(
HashList& list, 
int offset = 0);
 
 3643     GenObject* 
get(
unsigned int index) 
const;
 
 3664         { 
return m_current >= m_length; }
 
 3676     unsigned int* m_hashes;
 
 3677     unsigned int m_length;
 
 3678     unsigned int m_current;
 
 3707     inline explicit Time(
const struct timeval* tv)
 
 3708         : m_time(fromTimeval(tv))
 
 3715     inline explicit Time(
const struct timeval& tv)
 
 3716         : m_time(fromTimeval(tv))
 
 3731         { 
return (u_int32_t)((m_time+500000) / 1000000); }
 
 3738         { 
return (m_time+500) / 1000; }
 
 3750     inline operator u_int64_t()
 const 
 3757         { m_time = usec; 
return *
this; }
 
 3763         { m_time += delta; 
return *
this; }
 
 3769         { m_time -= delta; 
return *
this; }
 
 3776         { toTimeval(tv, m_time); }
 
 3783     static void toTimeval(
struct timeval* tv, u_int64_t usec);
 
 3790     static u_int64_t fromTimeval(
const struct timeval* tv);
 
 3798         { 
return fromTimeval(&tv); }
 
 3804     static u_int64_t now();
 
 3810     static u_int64_t msecNow();
 
 3816     static u_int32_t secNow();
 
 3831     static unsigned int toEpoch(
int year, 
unsigned int month, 
unsigned int day,
 
 3832         unsigned int hour, 
unsigned int minute, 
unsigned int sec, 
int offset = 0);
 
 3846     static bool toDateTime(
unsigned int epochTimeSec, 
int& year, 
unsigned int& month,
 
 3847         unsigned int& day, 
unsigned int& hour, 
unsigned int& minute, 
unsigned int& sec,
 
 3848         unsigned int* wDay = 0);
 
 3857     static uint32_t toNtp(uint32_t sec, uint32_t* over = 0, 
bool rfc2030 = 
true);
 
 3865     inline uint32_t 
toNtp(uint32_t* over = 0, 
bool rfc2030 = 
true)
 
 3866         { 
return toNtp(sec(),over,rfc2030); }
 
 3876     static uint32_t fromNtp(uint32_t val, uint32_t* under = 0, 
bool rfc2030 = 
true);
 
 3889     static unsigned int toString(
char* buf, uint64_t time, 
int frac = 0);
 
 3904             unsigned int n = toString(tmp,time,frac);
 
 3919     static uint64_t toEpoch(
const char* buf, 
unsigned int len, 
int frac = 0);
 
 3927         { 
return (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)); }
 
 3933     static int timeZone();
 
 3958     inline u_int32_t 
get() 
const 
 3959         { 
return m_random; }
 
 3965     inline void set(u_int32_t seed)
 
 3966         { m_random = seed; }
 
 3978     static long int random();
 
 3984     static void srandom(
unsigned int seed);
 
 4024     DataBlock(
void* value, 
unsigned int len, 
bool copyData = 
true, 
unsigned int overAlloc = 0);
 
 4036     virtual void* getObject(
const String& name) 
const;
 
 4056     inline unsigned char* 
data(
unsigned int offs, 
unsigned int len = 1)
 const 
 4057         { 
return (offs + len <= m_length) ? (
static_cast<unsigned char*
>(m_data) + offs) : 0; }
 
 4065     inline int at(
unsigned int offs, 
int defvalue = -1)
 const 
 4066         { 
return (offs < m_length) ? 
static_cast<unsigned char*
>(m_data)[offs] : defvalue; }
 
 4080         { 
return m_length; }
 
 4087         { 
return m_overAlloc; }
 
 4094         { m_overAlloc = bytes; }
 
 4100     void clear(
bool deleteData = 
true);
 
 4109     DataBlock& assign(
void* value, 
unsigned int len, 
bool copyData = 
true, 
unsigned int allocated = 0);
 
 4116     inline void append(
void* value, 
unsigned int len) {
 
 4132     void append(
const String& value);
 
 4145             if (len != length())
 
 4153     void truncate(
unsigned int len);
 
 4167         { 
return at(index); }
 
 4175         { 
return at(index); }
 
 4186         { append(value); 
return *
this; }
 
 4192         { append(value); 
return *
this; }
 
 4203         const String& dFormat, 
unsigned maxlen = 0);
 
 4215     bool unHexify(
const char* data, 
unsigned int len, 
char sep);
 
 4226     bool unHexify(
const char* data, 
unsigned int len);
 
 4242     String sqlEscape(
char extraEsc) 
const;
 
 4245     unsigned int allocLen(
unsigned int len) 
const;
 
 4247     unsigned int m_length;
 
 4248     unsigned int m_allocated;
 
 4249     unsigned int m_overAlloc;
 
 4267     virtual void clear() = 0;
 
 4273     virtual void finalize() = 0;
 
 4280     virtual const unsigned char* rawDigest() = 0;
 
 4288         { finalize(); 
return m_hex; }
 
 4296     inline bool update(
const void* buf, 
unsigned int len)
 
 4297         { 
return updateInternal(buf,len); }
 
 4305         { 
return updateInternal(data.
data(), data.
length()); }
 
 4313         { 
return updateInternal(str.
c_str(), str.
length()); }
 
 4320         { update(value); 
return *
this; }
 
 4327         { update(data); 
return *
this; }
 
 4342     bool hmacStart(
DataBlock& opad, 
const void* key, 
unsigned int keyLen);
 
 4351         { 
return hmacStart(opad,key.
data(),key.
length()); }
 
 4360         { 
return hmacStart(opad,key.
c_str(),key.
length()); }
 
 4377     bool hmac(
const void* key, 
unsigned int keyLen, 
const void* msg, 
unsigned int msgLen);
 
 4401     virtual unsigned int hashLength() 
const = 0;
 
 4407     virtual unsigned int hmacBlockSize() 
const;
 
 4423     virtual bool updateInternal(
const void* buf, 
unsigned int len) = 0;
 
 4445     MD5(
const MD5& original);
 
 4452     MD5(
const void* buf, 
unsigned int len);
 
 4469     MD5& operator=(
const MD5& original);
 
 4479     virtual void clear();
 
 4485     virtual void finalize();
 
 4492     virtual const unsigned char* rawDigest();
 
 4509     bool updateInternal(
const void* buf, 
unsigned int len);
 
 4513     unsigned char m_bin[16];
 
 4539     SHA1(
const void* buf, 
unsigned int len);
 
 4556     SHA1& operator=(
const SHA1& original);
 
 4566     virtual void clear();
 
 4572     virtual void finalize();
 
 4579     virtual const unsigned char* rawDigest();
 
 4606     bool updateInternal(
const void* buf, 
unsigned int len);
 
 4610     unsigned char m_bin[20];
 
 4636     SHA256(
const void* buf, 
unsigned int len);
 
 4663     virtual void clear();
 
 4669     virtual void finalize();
 
 4676     virtual const unsigned char* rawDigest();
 
 4693     bool updateInternal(
const void* buf, 
unsigned int len);
 
 4697     unsigned char m_bin[32];
 
 4720     inline Base64(
void* src, 
unsigned int len, 
bool copyData = 
true)
 
 4733     void encode(
String& dest, 
unsigned int lineLen = 0, 
bool lineAtEnd = 
false);
 
 4746     bool decode(
DataBlock& dest, 
bool liberal = 
true);
 
 4752         { append(value); 
return *
this; }
 
 4758         { append(data); 
return *
this; }
 
 4767 class NamedIterator;
 
 4809     virtual void* getObject(
const String& name) 
const;
 
 4816         { 
return m_params.length(); }
 
 4823         { 
return m_params.count(); }
 
 4829         { m_params.clear(); }
 
 4845     NamedList& addParam(
const char* name, 
const char* value, 
bool emptyOK = 
true);
 
 4855             m_params.setUnique(param);
 
 4926         bool skipPrefix = 
true, 
bool replace = 
false);
 
 4933     bool hasSubParams(
const char* prefix) 
const;
 
 4947     int getIndex(
const String& name) 
const;
 
 4976     const char* getValue(
const String& name, 
const char* defvalue = 0) 
const;
 
 4988     int getIntValue(
const String& name, 
int defvalue = 0, 
int minvalue = INT_MIN,
 
 4989         int maxvalue = INT_MAX, 
bool clamp = 
true) 
const;
 
 4998     int getIntValue(
const String& name, 
const TokenDict* tokens, 
int defvalue = 0) 
const;
 
 5010     int64_t getInt64Value(
const String& name, int64_t defvalue = 0, int64_t minvalue = LLONG_MIN,
 
 5011         int64_t maxvalue = LLONG_MAX, 
bool clamp = 
true) 
const;
 
 5019     double getDoubleValue(
const String& name, 
double defvalue = 0.0) 
const;
 
 5027     bool getBoolValue(
const String& name, 
bool defvalue = 
false) 
const;
 
 5036     int replaceParams(
String& str, 
bool sqlEsc = 
false, 
char extraEsc = 0) 
const;
 
 5046     void dump(
String& str, 
const char* separator, 
char quote = 0, 
bool force = 
false) 
const;
 
 5059         { 
return &m_params; }
 
 5066         { 
return &m_params; }
 
 5086         : m_list(&list), m_item(list.m_params.skipNull())
 
 5094         : m_list(original.m_list), m_item(original.m_item)
 
 5102         { m_list = &list; m_item = list.m_params.
skipNull(); 
return *
this; }
 
 5109         { m_list = original.m_list; m_item = original.m_item; 
return *
this; }
 
 5127         { m_item = m_list->m_params.skipNull(); }
 
 5164     explicit URI(
const char* uri);
 
 5174     URI(
const char* proto, 
const char* user, 
const char* host, 
int port = 0, 
const char* desc = 0);
 
 5207         { parse(); 
return m_desc; }
 
 5214         { parse(); 
return m_proto; }
 
 5221         { parse(); 
return m_user; }
 
 5228         { parse(); 
return m_host; }
 
 5235         { parse(); 
return m_port; }
 
 5242         { parse(); 
return m_extra; }
 
 5250     virtual void changed();
 
 5251     mutable bool m_parsed;
 
 5261 class SemaphorePrivate;
 
 5262 class ThreadPrivate;
 
 5281     virtual bool lock(
long maxwait = -1) = 0;
 
 5287     virtual bool unlock() = 0;
 
 5294     virtual bool locked() 
const = 0;
 
 5301     virtual bool check(
long maxwait = -1);
 
 5309     virtual bool unlockAll();
 
 5316     static void wait(
unsigned long maxwait);
 
 5322     static unsigned long wait();
 
 5330     static void startUsingNow();
 
 5338     static void enableSafety(
bool safe = 
true);
 
 5344     static bool safety();
 
 5353     friend class MutexPrivate;
 
 5361     explicit Mutex(
bool recursive = 
false, 
const char* name = 0);
 
 5385     virtual bool lock(
long maxwait = -1);
 
 5391     virtual bool unlock();
 
 5398     virtual bool locked() 
const;
 
 5404     const char* owner() 
const;
 
 5410     bool recursive() 
const;
 
 5428     static bool efficientTimedLock();
 
 5431     MutexPrivate* privDataCopy() 
const;
 
 5432     MutexPrivate* m_private;
 
 5454     MutexPool(
unsigned int len = 13, 
bool recursive = 
false, 
const char* name = 0);
 
 5468     inline unsigned int index(
void* ptr)
 const 
 5469         { 
return ((
unsigned int)(
unsigned long)ptr) % m_length; }
 
 5479         { 
return m_data[index(ptr)]; }
 
 5487         { 
return m_data[idx % m_length]; }
 
 5492     unsigned int m_length;               
 
 5501     friend class SemaphorePrivate;
 
 5509     explicit Semaphore(
unsigned int maxcount = 1, 
const char* name = 0,
 
 5510         unsigned int initialCount = 1);
 
 5534     virtual bool lock(
long maxwait = -1);
 
 5540     virtual bool unlock();
 
 5547     virtual bool locked() 
const;
 
 5565     static bool efficientTimedLock();
 
 5568     SemaphorePrivate* privDataCopy() 
const;
 
 5569     SemaphorePrivate* m_private;
 
 5587         { m_lock = lck.
lock(maxwait) ? &lck : 0; }
 
 5595         { m_lock = (lck && lck->
lock(maxwait)) ? lck : 0; }
 
 5601         { 
if (m_lock) m_lock->unlock(); }
 
 5614         { 
if (m_lock) m_lock->unlock(); m_lock = 0; }
 
 5623         { 
return (lck && (lck == m_lock)) ||
 
 5624             (drop(),(lck && (m_lock = lck->
lock(maxwait) ? lck : 0))); }
 
 5633         { 
return acquire(&lck,maxwait); }
 
 5639     inline void* 
operator new(size_t);
 
 5642     inline void* 
operator new[](size_t);
 
 5662         : m_mx1(0), m_mx2(0)
 
 5663         { lock(mx1,mx2,maxwait); }
 
 5672         : m_mx1(0), m_mx2(0)
 
 5673         { lock(&mx1,&mx2,maxwait); }
 
 5686         { 
return m_mx1 != 0; }
 
 5695     bool lock(
Mutex* mx1, 
Mutex* mx2, 
long maxwait = -1);
 
 5705         { 
return lock(&mx1,&mx2,maxwait); }
 
 5717     inline void* 
operator new(size_t);
 
 5720     inline void* 
operator new[](size_t);
 
 5735     virtual void run() = 0;
 
 5751     friend class ThreadPrivate;
 
 5752     friend class MutexPrivate;
 
 5753     friend class SemaphorePrivate;
 
 5770     virtual void cleanup();
 
 5788     bool running() 
const;
 
 5802         { 
return m_locking || m_locks; }
 
 5808     const char* name() 
const;
 
 5814     static const char* currentName();
 
 5821     static void yield(
bool exitCheck = 
false);
 
 5828     static void idle(
bool exitCheck = 
false);
 
 5835     static void sleep(
unsigned int sec, 
bool exitCheck = 
false);
 
 5842     static void msleep(
unsigned long msec, 
bool exitCheck = 
false);
 
 5850     static void usleep(
unsigned long usec, 
bool exitCheck = 
false);
 
 5856     static unsigned long idleUsec();
 
 5862     static unsigned long idleMsec();
 
 5868     static void idleMsec(
unsigned long msec);
 
 5875     static Thread* current();
 
 5888     static bool check(
bool exitNow = 
true);
 
 5899     void cancel(
bool hard = 
false);
 
 5906         { 
return current() == 
this; }
 
 5926     static NamedCounter* getCurrentObjCounter(
bool always = 
false);
 
 5941     static Priority priority(
const char* name, Priority defvalue = Normal);
 
 5948     static const char* priority(Priority prio);
 
 5954     static void killall();
 
 5960     static void preExec();
 
 5967     static int lastError();
 
 5976         { 
return errorString(buffer,lastError()); }
 
 5988     static bool errorString(
String& buffer, 
int code);
 
 5996     Thread(
const char *name = 0, Priority prio = Normal);
 
 6003     Thread(
const char *name, 
const char* prio);
 
 6011     ThreadPrivate* m_private;
 
 6030         : m_saved(0), m_enabled(enable)
 
 6039         : m_saved(0), m_enabled(enable && obj)
 
 6048         : m_saved(0), m_enabled(enable)
 
 6076         Unknown = AF_UNSPEC,
 
 6079         AfUnsupported = AfMax,
 
 6083         IPv6 = AfUnsupported + 1,
 
 6088         Unix = AfUnsupported + 2,
 
 6096         : m_address(0), m_length(0)
 
 6105           m_address(0), m_length(0)
 
 6113     explicit SocketAddr(
int family, 
const void* raw = 0);
 
 6120     SocketAddr(
const struct sockaddr* addr, socklen_t len = 0);
 
 6139     bool operator==(
const SocketAddr& other) 
const;
 
 6147         { 
return !operator==(other); }
 
 6159     bool assign(
int family);
 
 6166     void assign(
const struct sockaddr* addr, socklen_t len = 0);
 
 6187         { 
return m_length && m_address; }
 
 6194         { 
return !(m_length && m_address); }
 
 6201         { 
return m_address ? m_address->sa_family : 0; }
 
 6208         { 
return lookupFamily(family()); }
 
 6215         { 
return scopeId(address()); }
 
 6223         { 
return scopeId(address(),val); }
 
 6248     virtual bool host(
const String& name);
 
 6261     bool port(
int newport);
 
 6268         { 
return m_address; }
 
 6275         { 
return m_length; }
 
 6282         { 
return isNullAddr(m_host,family()); }
 
 6296     static bool supports(
int family);
 
 6303     static int family(
const String& addr);
 
 6311     static bool stringify(
String& buf, 
struct sockaddr* addr);
 
 6322         int family = Unknown) {
 
 6324             return sa.
host(host) ? copyAddr(buf,sa.
address()) : Unknown;
 
 6334     static int copyAddr(uint8_t* buf, 
struct sockaddr* addr);
 
 6341     static inline unsigned int scopeId(
struct sockaddr* addr) {
 
 6343             if (addr && addr->sa_family == AF_INET6)
 
 6344                 return ((
struct sockaddr_in6*)addr)->sin6_scope_id;
 
 6355     static inline bool scopeId(
struct sockaddr* addr, 
unsigned int val) {
 
 6357             if (addr && addr->sa_family == AF_INET6) {
 
 6358                 ((
struct sockaddr_in6*)addr)->sin6_scope_id = val;
 
 6383         int family = Unknown) {
 
 6384             appendAddr(buf,addr,family) << 
":" << port;
 
 6397             appendTo(buf,addr,port,family);
 
 6407     static bool isNullAddr(
const String& addr, 
int family = Unknown);
 
 6430     static void split(
const String& buf, 
String& addr, 
int& port, 
bool portPresent = 
false);
 
 6438         { 
return lookup(family,s_familyName); }
 
 6444     static const String& ipv4NullAddr();
 
 6450     static const String& ipv6NullAddr();
 
 6456     static const TokenDict* dictFamilyName();
 
 6462     virtual void stringify();
 
 6467     virtual void updateAddr() 
const;
 
 6469     struct sockaddr* m_address;
 
 6502     virtual void* getObject(
const String& name) 
const;
 
 6508     virtual void timerTick(
const Time& when);
 
 6519     virtual bool received(
void* buffer, 
int length, 
int flags, 
const struct sockaddr* addr, socklen_t adrlen) = 0;
 
 6526         { 
return m_socket; }
 
 6570     virtual bool terminate() = 0;
 
 6576     virtual bool canRetry() 
const;
 
 6582     virtual bool inProgress() 
const;
 
 6588     virtual bool valid() 
const = 0;
 
 6595     virtual bool setBlocking(
bool block = 
true);
 
 6603     virtual int writeData(
const void* buffer, 
int length) = 0;
 
 6610     int writeData(
const char* str);
 
 6626         { 
return writeData(buf.
data(), buf.
length()); }
 
 6634     virtual int readData(
void* buffer, 
int length) = 0;
 
 6640     virtual int64_t length();
 
 6648     virtual int64_t seek(SeekPos pos, int64_t offset = 0);
 
 6655     inline int64_t 
seek(int64_t offset)
 
 6656         { 
return seek(SeekBegin,offset); }
 
 6664     static bool allocPipe(
Stream*& reader, 
Stream*& writer);
 
 6678     static bool supportsPipes();
 
 6684     static bool supportsPairs();
 
 6723         : m_data(data), m_offset(0)
 
 6752     virtual int writeData(
const void* buffer, 
int len);
 
 6760     virtual int readData(
void* buffer, 
int len);
 
 6767         { 
return m_data.length(); }
 
 6775     virtual int64_t seek(SeekPos pos, int64_t offset = 0);
 
 6806     explicit File(HANDLE handle);
 
 6825     virtual bool openPath(
const char* name, 
bool canWrite = 
false, 
bool canRead = 
true,
 
 6826         bool create = 
false, 
bool append = 
false, 
bool binary = 
false,
 
 6827         bool pubReadable = 
false, 
bool pubWritable = 
false);
 
 6833     virtual bool terminate();
 
 6839     void attach(HANDLE handle);
 
 6852         { 
return m_handle; }
 
 6858     virtual bool canRetry() 
const;
 
 6864     virtual bool valid() 
const;
 
 6870     static HANDLE invalidHandle();
 
 6877     virtual bool setBlocking(
bool block = 
true);
 
 6883     virtual int64_t length();
 
 6891     virtual int64_t seek(SeekPos pos, int64_t offset = 0);
 
 6899     virtual int writeData(
const void* buffer, 
int length);
 
 6907     virtual int readData(
void* buffer, 
int length);
 
 6914     bool getFileTime(
unsigned int& secEpoch);
 
 6922     virtual bool md5(
String& buffer);
 
 6931     static bool setFileTime(
const char* name, 
unsigned int secEpoch, 
int* error = 0);
 
 6940     static bool getFileTime(
const char* name, 
unsigned int& secEpoch, 
int* error = 0);
 
 6948     static bool exists(
const char* name, 
int* error = 0);
 
 6957     static bool rename(
const char* oldFile, 
const char* newFile, 
int* error = 0);
 
 6965     static bool remove(
const char* name, 
int* error = 0);
 
 6974     static bool md5(
const char* name, 
String& buffer, 
int* error = 0);
 
 6983     static bool mkDir(
const char* path, 
int* error = 0, 
int mode = -1);
 
 6991     static bool rmDir(
const char* path, 
int* error = 0);
 
 7004     static bool listDirectory(
const char* path, 
ObjList* dirs, 
ObjList* files,
 
 7013     static bool createPipe(
File& reader, 
File& writer);
 
 7038         LowDelay       = IPTOS_LOWDELAY,
 
 7039         MaxThroughput  = IPTOS_THROUGHPUT,
 
 7040         MaxReliability = IPTOS_RELIABILITY,
 
 7041         MinCost        = IPTOS_MINCOST,
 
 7072         ExpeditedFwd   = 0xb8,
 
 7085     explicit Socket(SOCKET handle);
 
 7093     Socket(
int domain, 
int type, 
int protocol = 0);
 
 7107     virtual bool create(
int domain, 
int type, 
int protocol = 0);
 
 7113     virtual bool terminate();
 
 7119     void attach(SOCKET handle);
 
 7132         { 
return m_handle; }
 
 7138     virtual bool canRetry() 
const;
 
 7144     virtual bool inProgress() 
const;
 
 7150     virtual bool valid() 
const;
 
 7156     static SOCKET invalidHandle();
 
 7162     static int socketError();
 
 7178     virtual bool setOption(
int level, 
int name, 
const void* value = 0, socklen_t length = 0);
 
 7189 #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY) 
 7190             int value = on ? 1 : 0;
 
 7191             return setOption(IPPROTO_IPV6,IPV6_V6ONLY,&value,
sizeof(value));
 
 7205     virtual bool getOption(
int level, 
int name, 
void* buffer, socklen_t* length);
 
 7228     virtual bool setTOS(
int tos);
 
 7236     inline bool setTOS(
const char* tos, 
int defTos = Normal)
 
 7237         { 
return setTOS(
lookup(tos,tosValues(),defTos)); }
 
 7243     virtual int getTOS();
 
 7250     virtual bool setBlocking(
bool block = 
true);
 
 7259     virtual bool setReuse(
bool reuse = 
true, 
bool exclusive = 
false);
 
 7267     virtual bool setLinger(
int seconds = -1);
 
 7275     virtual bool bind(
struct sockaddr* addr, socklen_t addrlen);
 
 7290     virtual bool listen(
unsigned int backlog = 0);
 
 7298     virtual Socket* accept(
struct sockaddr* addr = 0, socklen_t* addrlen = 0);
 
 7313     SOCKET acceptHandle(
struct sockaddr* addr = 0, socklen_t* addrlen = 0);
 
 7328     static bool efficientSelect();
 
 7335     static bool canSelect(SOCKET handle);
 
 7341     virtual bool canSelect() 
const;
 
 7349     virtual bool connect(
struct sockaddr* addr, socklen_t addrlen);
 
 7368     virtual bool connectAsync(
struct sockaddr* addr, socklen_t addrlen, 
unsigned int toutUs,
 
 7381         { 
return connectAsync(addr.
address(),addr.
length(),toutUs,timeout); }
 
 7389     virtual bool shutdown(
bool stopReads, 
bool stopWrites);
 
 7397     virtual bool getSockName(
struct sockaddr* addr, socklen_t* addrlen);
 
 7412     virtual bool getPeerName(
struct sockaddr* addr, socklen_t* addrlen);
 
 7430     virtual int sendTo(
const void* buffer, 
int length, 
const struct sockaddr* addr, socklen_t adrlen, 
int flags = 0);
 
 7441         { 
return sendTo(buffer, length, addr.
address(), addr.
length(), flags); }
 
 7450     virtual int send(
const void* buffer, 
int length, 
int flags = 0);
 
 7458     virtual int writeData(
const void* buffer, 
int length);
 
 7469     virtual int recvFrom(
void* buffer, 
int length, 
struct sockaddr* addr = 0, socklen_t* adrlen = 0, 
int flags = 0);
 
 7479     int recvFrom(
void* buffer, 
int length, 
SocketAddr& addr, 
int flags = 0);
 
 7488     virtual int recv(
void* buffer, 
int length, 
int flags = 0);
 
 7496     virtual int readData(
void* buffer, 
int length);
 
 7506     virtual bool select(
bool* readok, 
bool* writeok, 
bool* except, 
struct timeval* timeout = 0);
 
 7516     bool select(
bool* readok, 
bool* writeok, 
bool* except, int64_t timeout);
 
 7530     void removeFilter(
SocketFilter* filter, 
bool delobj = 
false);
 
 7535     void clearFilters();
 
 7543     virtual void timerTick(
const Time& when);
 
 7552     static bool createPair(
Socket& sock1, 
Socket& sock2, 
int domain = AF_UNIX);
 
 7567     bool checkError(
int retcode, 
bool strict = 
false);
 
 7578     bool applyFilters(
void* buffer, 
int length, 
int flags, 
const struct sockaddr* addr = 0, socklen_t adrlen = 0);
 
 7616     virtual bool bindx(
ObjList& addresses) = 0;
 
 7623     virtual bool connectx(
ObjList& addresses) = 0;
 
 7634     virtual int sendTo(
void* buffer, 
int length, 
int stream, 
SocketAddr& addr, 
int flags) = 0;
 
 7652     virtual int sendMsg(
const void* buf, 
int length, 
int stream, 
int& flags) = 0;
 
 7663     virtual int recvMsg(
void* buf, 
int length, 
SocketAddr& addr, 
int& stream, 
int& flags) = 0;
 
 7671     virtual bool setStreams(
int inbound, 
int outbound) = 0;
 
 7678     virtual bool subscribeEvents() = 0;
 
 7686     virtual bool getStreams(
int& inbound, 
int& outbound) = 0;
 
 7693     virtual bool setPayload(u_int32_t payload) = 0;
 
 7748         : m_ttl(ttl), m_order(order), m_pref(pref)
 
 7755         : m_order(0), m_pref(0)
 
 7784     virtual void dump(
String& buf, 
const char* sep = 
" ");
 
 7831     virtual void dump(
String& buf, 
const char* sep = 
" ");
 
 7864     inline SrvRecord(
int ttl, 
int prio, 
int weight, 
const char* addr, 
int port)
 
 7865         : 
DnsRecord(ttl,prio,weight), m_address(addr), m_port(port)
 
 7873         { 
return m_address; }
 
 7887     virtual void dump(
String& buf, 
const char* sep = 
" ");
 
 7923     NaptrRecord(
int ttl, 
int ord, 
int pref, 
const char* flags, 
const char* serv,
 
 7924         const char* regexp, 
const char* next);
 
 7932     bool replace(
String& str) 
const;
 
 7939     virtual void dump(
String& buf, 
const char* sep = 
" ");
 
 7953         { 
return m_service; }
 
 7960         { 
return m_regmatch; }
 
 7967         { 
return m_template; }
 
 8012     static bool available(Type type = Unknown);
 
 8020     static bool init(
int timeout = -1, 
int retries = -1);
 
 8030     static int query(Type type, 
const char* dname, 
ObjList& result, 
String* error = 0);
 
 8039     static int srvQuery(
const char* dname, 
ObjList& result, 
String* error = 0);
 
 8048     static int naptrQuery(
const char* dname, 
ObjList& result, 
String* error = 0);
 
 8057     static int a4Query(
const char* dname, 
ObjList& result, 
String* error = 0);
 
 8066     static int a6Query(
const char* dname, 
ObjList& result, 
String* error = 0);
 
 8075     static int txtQuery(
const char* dname, 
ObjList& result, 
String* error = 0);
 
 8104         { 
return s_directions; }
 
 8125     virtual void* getObject(
const String& name) 
const;
 
 8132     virtual bool valid(Direction dir = Bidir) 
const;
 
 8138     virtual unsigned int blockSize() 
const = 0;
 
 8144     virtual unsigned int initVectorSize() 
const;
 
 8151     unsigned int bufferSize(
unsigned int len) 
const;
 
 8158     bool bufferFull(
unsigned int len) 
const;
 
 8167     virtual bool setKey(
const void* key, 
unsigned int len, Direction dir = Bidir) = 0;
 
 8176         { 
return setKey(key.
data(),key.
length(),dir); }
 
 8185     virtual bool initVector(
const void* vect, 
unsigned int len, Direction dir = Bidir);
 
 8194         { 
return initVector(vect.
data(),vect.
length(),dir); }
 
 8203     virtual bool encrypt(
void* outData, 
unsigned int len, 
const void* inpData = 0) = 0;
 
 8211         { 
return encrypt(data.
data(),data.
length()); }
 
 8220     virtual bool decrypt(
void* outData, 
unsigned int len, 
const void* inpData = 0) = 0;
 
 8228         { 
return decrypt(data.
data(),data.
length()); }
 
 8250         : 
String(name), m_format(format)
 
 8264         { 
return m_format; }
 
 8273     virtual bool init(
bool comp = 
true, 
bool decomp = 
true,
 
 8292     virtual int compress(
const void* buf, 
unsigned int len, 
DataBlock& dest);
 
 8302     virtual int decompress(
const void* buf, 
unsigned int len, 
DataBlock& dest);
 
 8314     virtual int writeComp(
const void* buf, 
unsigned int len, 
bool flush) = 0;
 
 8325         { 
return writeComp(data.
data(),data.
length(),flush); }
 
 8336         { 
return writeComp(data.
c_str(),data.
length(),flush); }
 
 8344     virtual int readComp(
DataBlock& buf, 
bool flush) = 0;
 
 8354     virtual int writeDecomp(
const void* buf, 
unsigned int len, 
bool flush) = 0;
 
 8364         { 
return writeDecomp(data.
data(),data.
length(),flush); }
 
 8374         { 
return writeDecomp(data.
c_str(),data.
length(),flush); }
 
 8382     virtual int readDecomp(
DataBlock& buf, 
bool flush) = 0;
 
 8414     static u_int64_t startTime();
 
 8421     static u_int64_t usecRunTime(Type type = WallTime);
 
 8428     static u_int64_t msecRunTime(Type type = WallTime);
 
 8435     static u_int32_t secRunTime(Type type = WallTime);
 
 8442     static double runTime(Type type = WallTime);
 
const char * token
Definition: yateclass.h:704
A Mutex pool. 
Definition: yateclass.h:5441
int sendTo(const void *buffer, int length, const SocketAddr &addr, int flags=0)
Definition: yateclass.h:7440
Time & operator=(u_int64_t usec)
Definition: yateclass.h:3756
String & operator+=(bool value)
Definition: yateclass.h:2451
A DNS record. 
Definition: yateclass.h:7736
Internal helper class. 
Definition: yateclass.h:1073
const char * c_safe(const char *str)
Definition: yateclass.h:2944
int count() const 
Definition: yateclass.h:3421
bool null() const 
Definition: yateclass.h:2059
Abstract interface for lockable objects. 
Definition: yateclass.h:5268
int writeData(const DataBlock &buf)
Definition: yateclass.h:6625
RefPointer(const RefPointer< Obj > &value)
Definition: yateclass.h:1127
const char * debugColor(int level)
Compressor(const char *format, const char *name=0)
Definition: yateclass.h:8249
GenPointer()
Definition: yateclass.h:1191
DataBlock & operator+=(const DataBlock &value)
Definition: yateclass.h:4185
int locks() const 
Definition: yateclass.h:5794
GenObject * operator[](unsigned int index) const 
Definition: yateclass.h:1565
static bool alive(const RefObject *obj)
Definition: yateclass.h:1031
UChar & operator=(char code)
Definition: yateclass.h:1809
unsigned int index(void *ptr) const 
Definition: yateclass.h:5468
void setDelete(bool autodelete)
Definition: yateclass.h:1622
bool hmacStart(DataBlock &opad, const DataBlock &key)
Definition: yateclass.h:4350
const char * c_str() const 
Definition: yateclass.h:2030
GenObject * operator[](signed int index) const 
Definition: yateclass.h:1557
A class that holds just a block of raw data. 
Definition: yateclass.h:3994
ObjList * getList(unsigned int index) const 
Definition: yateclass.h:3478
String sqlEscape(char extraEsc=0) const 
Definition: yateclass.h:2862
int debugLevel() const 
Definition: yateclass.h:328
ObjList * next() const 
Definition: yateclass.h:1299
const String & getUser() const 
Definition: yateclass.h:5220
u_int32_t sec() const 
Definition: yateclass.h:3730
bool isNullAddr() const 
Definition: yateclass.h:6281
UChar(uint32_t code=0)
Definition: yateclass.h:1768
Definition: yateclass.h:967
int value
Definition: yateclass.h:692
A regexp matching class. 
Definition: yateclass.h:3051
NamedIterator(const NamedList &list)
Definition: yateclass.h:5085
static void setObjCounting(bool enable)
Definition: yateclass.h:910
void Debug(int level, const char *format,...)
static const char * lookupFamily(int family)
Definition: yateclass.h:6437
SOCKET handle() const 
Definition: yateclass.h:7131
static unsigned int scopeId(struct sockaddr *addr)
Definition: yateclass.h:6341
A captured event string with a debug level. 
Definition: yateclass.h:3183
const char * safe(const char *defStr) const 
Definition: yateclass.h:2045
Regexp & operator=(const char *value)
Definition: yateclass.h:3082
String matchString(int index=0) const 
Definition: yateclass.h:2783
Mutex * mutex(void *ptr) const 
Definition: yateclass.h:5478
GenPointer< Obj > & operator=(Obj *object)
Definition: yateclass.h:1220
RefPointer()
Definition: yateclass.h:1120
String & operator<<(int64_t value)
Definition: yateclass.h:2519
SocketAddr & operator=(const SocketAddr &value)
Definition: yateclass.h:6131
~Lock2()
Definition: yateclass.h:5678
GenObject * operator[](unsigned int index) const 
Definition: yateclass.h:1347
GenPointer< Obj > & operator=(const GenPointer< Obj > &value)
Definition: yateclass.h:1214
ObjList * skipNull() const 
A NAPTR record. 
Definition: yateclass.h:7908
void toTimeval(struct timeval *tv) const 
Definition: yateclass.h:3775
bool eof() const 
Definition: yateclass.h:3663
static bool capturing()
Definition: yateclass.h:3217
MemoryStream()
Definition: yateclass.h:6714
bool decrypt(DataBlock &data)
Definition: yateclass.h:8227
uint32_t code() const 
Definition: yateclass.h:1816
virtual bool init(bool comp=true, bool decomp=true, const NamedList ¶ms=NamedList::empty())
Definition: yateclass.h:8273
bool connectAsync(const SocketAddr &addr, unsigned int toutUs, bool *timeout=0)
Definition: yateclass.h:7379
A filter for received socket data. 
Definition: yateclass.h:6482
const String & hexDigest()
Definition: yateclass.h:4287
const char * strcat(String &dest, const char *src)
Definition: yateclass.h:2997
const String & format() const 
Definition: yateclass.h:8263
NamedIterator & operator=(const NamedList &list)
Definition: yateclass.h:5101
const String & address() const 
Definition: yateclass.h:7872
bool autoDelete()
Definition: yateclass.h:1446
UChar(int32_t code)
Definition: yateclass.h:1776
Formatting
Definition: yateclass.h:576
virtual ~GenObject()
Definition: yateclass.h:860
static void append(int level, const char *text)
Definition: yateclass.h:3232
Thread support class. 
Definition: yateclass.h:5749
bool update(const String &str)
Definition: yateclass.h:4312
bool locked() const 
Definition: yateclass.h:5801
const String & getExtra() const 
Definition: yateclass.h:5241
~Lock()
Definition: yateclass.h:5600
int writeDecomp(const String &data, bool flush)
Definition: yateclass.h:8373
SeekPos
Definition: yateclass.h:6548
constant YSTRING(const char *string)
A stream file class. 
Definition: yateclass.h:6793
bool hmac(const String &key, const String &msg)
Definition: yateclass.h:4394
static int unStringify(uint8_t *buf, const String &host, int family=Unknown)
Definition: yateclass.h:6321
const Regexp & regexp() const 
Definition: yateclass.h:7959
RefPointer< Obj > & operator=(const RefPointer< Obj > &value)
Definition: yateclass.h:1147
static const char * boolText(bool value)
Definition: yateclass.h:2023
bool lock(Mutex &mx1, Mutex &mx2, long maxwait=-1)
Definition: yateclass.h:5704
static unsigned int appendTo(String &buf, uint64_t time, int frac=0)
Definition: yateclass.h:3902
Stream()
Definition: yateclass.h:6690
unsigned int length() const 
Definition: yateclass.h:4815
static bool getObjCounting()
Definition: yateclass.h:903
bool null() const 
Definition: yateclass.h:6193
void enable(bool val)
Definition: yateclass.h:3402
String uriEscape(char extraEsc=0, const char *noEsc=0) const 
Definition: yateclass.h:2889
bool compile() const 
Definition: yateclass.h:3089
bool checkBOM() const 
Definition: yateclass.h:2133
bool hmac(const DataBlock &key, const DataBlock &msg)
Definition: yateclass.h:4385
const String & flags() const 
Definition: yateclass.h:7945
Socket * socket() const 
Definition: yateclass.h:6525
virtual unsigned int hashLength() const 
Definition: yateclass.h:4689
Lock(Lockable &lck, long maxwait=-1)
Definition: yateclass.h:5586
An abstract cipher. 
Definition: yateclass.h:8087
virtual unsigned int hashLength() const 
Definition: yateclass.h:4592
~RefPointer()
Definition: yateclass.h:1141
unsigned int length() const 
Definition: yateclass.h:3463
u_int64_t msec() const 
Definition: yateclass.h:3737
ObjList * getColumn(int column) const 
Definition: yateclass.h:1737
Time()
Definition: yateclass.h:3691
SocketRef(Socket *&socket)
Definition: yateclass.h:7715
unsigned char * data(unsigned int offs, unsigned int len=1) const 
Definition: yateclass.h:4056
void XDebug(int level, const char *format,...)
static unsigned int rawLength()
Definition: yateclass.h:4585
Base64(void *src, unsigned int len, bool copyData=true)
Definition: yateclass.h:4720
String & operator<<(const char *value)
Definition: yateclass.h:2495
bool connect(const SocketAddr &addr)
Definition: yateclass.h:7356
int port() const 
Definition: yateclass.h:7879
Obj * pointer() const 
Definition: yateclass.h:1106
String uriUnescape(int *errptr=0) const 
Definition: yateclass.h:2905
~Time()
Definition: yateclass.h:3723
A socket address holder. 
Definition: yateclass.h:6068
ObjVector(bool autodelete=true)
Definition: yateclass.h:1493
static u_int64_t fromTimeval(const struct timeval &tv)
Definition: yateclass.h:3797
bool debugChained() const 
Definition: yateclass.h:370
void resize(unsigned int len)
Definition: yateclass.h:4144
int order() const 
Definition: yateclass.h:7769
URI & operator=(const char *value)
Definition: yateclass.h:5199
const String & name() const 
Definition: yateclass.h:3275
SocketRef(Socket **socket)
Definition: yateclass.h:7707
static const String * atom(const String *&str, const char *val)
String & operator<<(uint64_t value)
Definition: yateclass.h:2525
const char * debugName() const 
Definition: yateclass.h:356
virtual int64_t length()
Definition: yateclass.h:6766
virtual ~Compressor()
Definition: yateclass.h:8256
String & operator<<(double value)
Definition: yateclass.h:2537
A list based Array. 
Definition: yateclass.h:1639
MemoryStream(const DataBlock &data)
Definition: yateclass.h:6722
bool bind(const SocketAddr &addr)
Definition: yateclass.h:7282
unsigned int length() const 
Definition: yateclass.h:3615
virtual void * getObject(const String &name) const 
SrvRecord(int ttl, int prio, int weight, const char *addr, int port)
Definition: yateclass.h:7864
NamedIterator & operator=(const NamedIterator &original)
Definition: yateclass.h:5108
void set(u_int32_t seed)
Definition: yateclass.h:3965
GenObject * remove(bool delobj=true)
void * userObject(const String &name) const 
Definition: yateclass.h:3350
const char * familyName()
Definition: yateclass.h:6207
const String & nextName() const 
Definition: yateclass.h:7973
void debugName(const char *name)
Definition: yateclass.h:391
Hasher()
Definition: yateclass.h:4413
RefPointer< Obj > & operator=(Obj *object)
Definition: yateclass.h:1153
GenObject * at(int index) const 
Definition: yateclass.h:1549
NamedList & setParam(NamedString *param)
Definition: yateclass.h:4852
Ephemeral object counter changer. 
Definition: yateclass.h:6020
static bool stripBOM(const char *&str)
Definition: yateclass.h:2141
bool acquire(Lockable &lck, long maxwait=-1)
Definition: yateclass.h:5632
virtual bool getParams(const String ¶ms, NamedList &result)
Definition: yateclass.h:7220
static ObjList & eventsRw()
Definition: yateclass.h:3240
Type
Definition: yateclass.h:7997
Encapsulates a runnable task. 
Definition: yateclass.h:5728
virtual bool valid() const 
Definition: yateclass.h:6743
CapturedEvent(int level, const char *text)
Definition: yateclass.h:3193
int writeComp(const String &data, bool flush)
Definition: yateclass.h:8335
Base64 & operator<<(const DataBlock &data)
Definition: yateclass.h:4757
Abstract SCTP Socket. 
Definition: yateclass.h:7588
struct sockaddr * address() const 
Definition: yateclass.h:6267
A standard SHA1 digest calculator. 
Definition: yateclass.h:4520
GenPointer(Obj *object)
Definition: yateclass.h:1207
uint32_t toNtp(uint32_t *over=0, bool rfc2030=true)
Definition: yateclass.h:3865
Time(const struct timeval *tv)
Definition: yateclass.h:3707
Encapsulation for an URI. 
Definition: yateclass.h:5140
int family() const 
Definition: yateclass.h:6200
unsigned int count() const 
Definition: yateclass.h:4822
void overAlloc(unsigned int bytes)
Definition: yateclass.h:4093
Time & operator-=(int64_t delta)
Definition: yateclass.h:3768
Hasher & operator<<(const String &value)
Definition: yateclass.h:4319
String & operator=(const String &value)
Definition: yateclass.h:2348
String & operator=(bool value)
Definition: yateclass.h:2400
static bool checkBOM(const char *str)
Definition: yateclass.h:2126
URI & operator=(const URI &value)
Definition: yateclass.h:5185
int operator[](signed int index) const 
Definition: yateclass.h:4166
A class exposing system resources usage. 
Definition: yateclass.h:8393
static void capturing(bool capture)
Definition: yateclass.h:3247
const char * token
Definition: yateclass.h:687
int lookup(const char *str, const TokenDict *tokens, int defvalue=0, int base=0)
int operator[](unsigned int index) const 
Definition: yateclass.h:4174
CapturedEvent(const CapturedEvent &original)
Definition: yateclass.h:3201
bool eof() const 
Definition: yateclass.h:5120
GenObject * operator[](signed int index) const 
Definition: yateclass.h:1339
virtual void * getObject(const String &name) const 
Definition: yateclass.h:7724
Base64 & operator<<(const String &value)
Definition: yateclass.h:4751
void destruct(GenObject *obj)
Definition: yateclass.h:951
bool initVector(const DataBlock &vect, Direction dir=Bidir)
Definition: yateclass.h:8193
static unsigned int rawLength()
Definition: yateclass.h:4498
const String & host() const 
Definition: yateclass.h:6229
bool scopeId(unsigned int val)
Definition: yateclass.h:6222
URI & operator=(const String &value)
Definition: yateclass.h:5192
char operator[](signed int index) const 
Definition: yateclass.h:2300
void assign(RefObject *oldptr, RefObject *newptr, void *pointer)
int64_t seek(int64_t offset)
Definition: yateclass.h:6655
ObjList * paramList()
Definition: yateclass.h:5058
UChar(unsigned char code)
Definition: yateclass.h:1792
UChar & operator=(uint32_t code)
Definition: yateclass.h:1801
static String & appendTo(String &buf, const String &addr, int port, int family=Unknown)
Definition: yateclass.h:6382
Obj & operator*() const 
Definition: yateclass.h:1172
TxtRecord(int ttl, const char *text)
Definition: yateclass.h:7815
RefPointer(Obj *object)
Definition: yateclass.h:1135
DSCP
Definition: yateclass.h:7047
GenObject * userData() const 
Definition: yateclass.h:3328
A single Unicode character. 
Definition: yateclass.h:1756
void append(void *value, unsigned int len)
Definition: yateclass.h:4116
bool unHexify(const String &data)
Definition: yateclass.h:4234
static String appendTo(const String &addr, int port, int family=Unknown)
Definition: yateclass.h:6395
A time holding class. 
Definition: yateclass.h:3685
Time & operator+=(int64_t delta)
Definition: yateclass.h:3762
static bool isLeap(unsigned int year)
Definition: yateclass.h:3926
SocketAddr(const SocketAddr &value)
Definition: yateclass.h:6103
const String & text() const 
Definition: yateclass.h:7823
const String * operator->() const 
Definition: yateclass.h:3172
virtual bool lock(long maxwait=-1)=0
Obj & operator*() const 
Definition: yateclass.h:1239
Direction
Definition: yateclass.h:8093
A holder for a debug level. 
Definition: yateclass.h:309
Lock2(Mutex *mx1, Mutex *mx2, long maxwait=-1)
Definition: yateclass.h:5661
RefObject holding a Socket pointer. 
Definition: yateclass.h:7700
A generic socket class. 
Definition: yateclass.h:7029
DataBlock m_data
Definition: yateclass.h:6781
virtual unsigned int hashLength() const 
Definition: yateclass.h:4505
int error() const 
Definition: yateclass.h:6563
void * data() const 
Definition: yateclass.h:4047
bool acquire(Lockable *lck, long maxwait=-1)
Definition: yateclass.h:5622
An abstract hashing class. 
Definition: yateclass.h:4256
DebugLevel
Definition: yateclass.h:254
TempObjectCounter(NamedCounter *counter, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:6029
static const NamedList & empty()
void reset()
Definition: yateclass.h:3669
String msgUnescape(int *errptr=0, char extraEsc=0) const 
Definition: yateclass.h:2846
int lenUtf8(uint32_t maxChar=0x10ffff, bool overlong=false) const 
Definition: yateclass.h:2077
String & operator<<(char value)
Definition: yateclass.h:2501
An object that logs messages on creation and destruction. 
Definition: yateclass.h:570
int getPort() const 
Definition: yateclass.h:5234
void reset()
Definition: yateclass.h:5126
Atom string holder. 
Definition: yateclass.h:3150
String & operator<<(int32_t value)
Definition: yateclass.h:2507
void debugChain(const DebugEnabler *chain=0)
Definition: yateclass.h:377
A named pointer class. 
Definition: yateclass.h:3308
bool enabled() const 
Definition: yateclass.h:3395
class * YOBJECT(class type, GenObject *pntr)
socklen_t length() const 
Definition: yateclass.h:6274
constant YATOM(const char *string)
String & operator<<(bool value)
Definition: yateclass.h:2531
bool setKey(const DataBlock &key, Direction dir=Bidir)
Definition: yateclass.h:8175
String & append(const char *value, int len)
void DDebug(int level, const char *format,...)
const String & getDescription() const 
Definition: yateclass.h:5206
Obj * operator->() const 
Definition: yateclass.h:1233
int64_t m_offset
Definition: yateclass.h:6786
A named string class. 
Definition: yateclass.h:3260
virtual void finalize(bool comp)
Definition: yateclass.h:8281
A standard SHA256 digest calculator. 
Definition: yateclass.h:4617
bool setTOS(const char *tos, int defTos=Normal)
Definition: yateclass.h:7236
String msgEscape(char extraEsc=0) const 
Definition: yateclass.h:2828
bool operator!=(const String &value) const 
Definition: yateclass.h:2479
static unsigned int rawLength()
Definition: yateclass.h:4682
void drop()
Definition: yateclass.h:5613
bool operator==(const String &value) const 
Definition: yateclass.h:2473
DNS services. 
Definition: yateclass.h:7991
int getColumns() const 
Definition: yateclass.h:1727
const char * c_str(const String *str)
Definition: yateclass.h:2936
DebugEnabler(int level=TelEngine::debugLevel(), bool enabled=true)
Definition: yateclass.h:317
bool null(const char *str)
Definition: yateclass.h:2960
void NDebug(int level, const char *format,...)
int pref() const 
Definition: yateclass.h:7776
static void * getObject(const String &name, const GenObject *obj)
Definition: yateclass.h:896
const String & getHost() const 
Definition: yateclass.h:5227
NamedCounter * getObjCounter() const 
Definition: yateclass.h:917
Base64 encoder/decoder class. 
Definition: yateclass.h:4704
void YCLASSIMP3(class type, class base1, class base2, class base3)
A hashed object list class. 
Definition: yateclass.h:3437
SctpSocket()
Definition: yateclass.h:7595
void clear(bool deleteData=true)
bool stripBOM()
Definition: yateclass.h:2156
const String & addr() const 
Definition: yateclass.h:6236
int refcount() const 
Definition: yateclass.h:1017
void YCLASSIMP(class type, class base)
Base64 & operator<<(const char *value)
Definition: yateclass.h:4763
A named string container class. 
Definition: yateclass.h:4773
String operator+(const String &s1, const String &s2)
void * m_pointer
Definition: yateclass.h:1093
DataBlock & operator+=(const String &value)
Definition: yateclass.h:4191
const String & getProtocol() const 
Definition: yateclass.h:5213
char operator[](unsigned int index) const 
Definition: yateclass.h:2308
virtual bool matches(const String &value) const 
Definition: yateclass.h:3104
Templated smart pointer class. 
Definition: yateclass.h:1099
Ephemeral mutex or semaphore locking object. 
Definition: yateclass.h:5577
Lock2(Mutex &mx1, Mutex &mx2, long maxwait=-1)
Definition: yateclass.h:5671
virtual Socket * accept(SocketAddr &addr)
Definition: yateclass.h:7641
bool hmacStart(DataBlock &opad, const String &key)
Definition: yateclass.h:4359
void YCLASS3(class type, class base1, class base2, class base3)
Pseudo random number generator. 
Definition: yateclass.h:3943
String & operator<<(String &str, const Complex &c)
Definition: yatemath.h:1685
GenPointer(const GenPointer< Obj > &value)
Definition: yateclass.h:1199
bool update(const void *buf, unsigned int len)
Definition: yateclass.h:4296
Hasher & operator<<(const DataBlock &data)
Definition: yateclass.h:4326
Semaphore implementation. 
Definition: yateclass.h:5499
An abstract stream class capable of reading and writing. 
Definition: yateclass.h:6542
void YCLASSIMP2(class type, class base1, class base2)
void clearError()
Definition: yateclass.h:6697
Base64()
Definition: yateclass.h:4711
String & append(const ObjList &list, const char *separator=0, bool force=false)
Definition: yateclass.h:2601
TempObjectCounter(const GenObject *obj, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:6038
A Stream that operates on DataBlocks in memory. 
Definition: yateclass.h:6707
Templated pointer that can be inserted in a list. 
Definition: yateclass.h:1179
bool encrypt(DataBlock &data)
Definition: yateclass.h:8210
virtual bool matches(const String &value) const 
Definition: yateclass.h:2754
static bool errorString(String &buffer)
Definition: yateclass.h:5975
virtual void * getObject(const String &name) const 
Time(const struct timeval &tv)
Definition: yateclass.h:3715
Ephemeral double mutex locking object. 
Definition: yateclass.h:5651
bool valid() const 
Definition: yateclass.h:6186
unsigned int length() const 
Definition: yateclass.h:1529
int writeDecomp(const DataBlock &data, bool flush)
Definition: yateclass.h:8363
int level() const 
Definition: yateclass.h:3209
SctpSocket(SOCKET fd)
Definition: yateclass.h:7602
ObjList * getHashList(const String &str) const 
Definition: yateclass.h:3494
bool isCurrent() const 
Definition: yateclass.h:5905
static NamedCounter * setCurrentObjCounter(NamedCounter *counter)
HANDLE handle() const 
Definition: yateclass.h:6851
static const ObjList & events()
Definition: yateclass.h:3224
A text based DNS record. 
Definition: yateclass.h:7805
Definition: yateclass.h:217
int writeData(const String &str)
Definition: yateclass.h:6617
int ttl() const 
Definition: yateclass.h:7762
const DataBlock & data() const 
Definition: yateclass.h:6730
TOS
Definition: yateclass.h:7036
NamedPointer & operator=(const char *value)
Definition: yateclass.h:3356
NamedString & operator=(const char *value)
Definition: yateclass.h:3294
const ObjList * paramList() const 
Definition: yateclass.h:5065
bool operator!=(const SocketAddr &other) const 
Definition: yateclass.h:6146
A C-style string handling class. 
Definition: yateclass.h:1924
Atom(const char *value)
Definition: yateclass.h:3157
void assign(Obj *object=0)
Definition: yateclass.h:1113
bool locked() const 
Definition: yateclass.h:5685
const char * strcpy(String &dest, const char *src)
Definition: yateclass.h:2990
Class used to iterate the items of a list. 
Definition: yateclass.h:3586
Definition: yateclass.h:683
static const TokenDict * directions()
Definition: yateclass.h:8103
Priority
Definition: yateclass.h:5759
const char * c_str() const 
Definition: yateclass.h:1823
bool setIpv6OnlyOption(bool on)
Definition: yateclass.h:7188
Time(u_int64_t usec)
Definition: yateclass.h:3699
bool autoDelete()
Definition: yateclass.h:1615
TempObjectCounter(const GenObject &obj, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:6047
const char * debugLevelName(int level)
DnsRecord(int ttl, int order, int pref)
Definition: yateclass.h:7747
virtual bool setParams(const NamedList ¶ms)
Definition: yateclass.h:7211
u_int64_t usec() const 
Definition: yateclass.h:3744
const char * safe() const 
Definition: yateclass.h:2037
int writeComp(const DataBlock &data, bool flush)
Definition: yateclass.h:8324
static bool scopeId(struct sockaddr *addr, unsigned int val)
Definition: yateclass.h:6355
void Output(const char *format,...)
const String & serv() const 
Definition: yateclass.h:7952
int64_t value
Definition: yateclass.h:709
An object list class. 
Definition: yateclass.h:1247
unsigned int length() const 
Definition: yateclass.h:4079
unsigned int length() const 
Definition: yateclass.h:2052
void Alarm(const char *component, int level, const char *format,...)
Lock(Lockable *lck, long maxwait=-1)
Definition: yateclass.h:5594
bool null() const 
Definition: yateclass.h:4072
void clearParams()
Definition: yateclass.h:4828
const String & repTemplate() const 
Definition: yateclass.h:7966
void YCLASS(class type, class base)
NamedIterator(const NamedIterator &original)
Definition: yateclass.h:5093
unsigned int scopeId() const 
Definition: yateclass.h:6214
void setDelete(bool autodelete)
Definition: yateclass.h:1453
~TempObjectCounter()
Definition: yateclass.h:6054
static bool stripBOM(char *&str)
Definition: yateclass.h:2149
bool debugEnabled() const 
Definition: yateclass.h:342
int at(unsigned int offs, int defvalue=-1) const 
Definition: yateclass.h:4065
bool update(const DataBlock &data)
Definition: yateclass.h:4304
Type
Definition: yateclass.h:8399
ObjList * getHashList(unsigned int hash) const 
Definition: yateclass.h:3486
DnsRecord()
Definition: yateclass.h:7754
NamedList parameters iterator. 
Definition: yateclass.h:5078
A vector holding GenObjects. 
Definition: yateclass.h:1485
virtual bool terminate()
Definition: yateclass.h:6737
A SRV record. 
Definition: yateclass.h:7851
Random(u_int32_t seed=Time::now()&0xffffffff)
Definition: yateclass.h:3950
Obj * operator->() const 
Definition: yateclass.h:1166
Definition: yateclass.h:700
Lockable * locked() const 
Definition: yateclass.h:5607
Mutex * mutex(unsigned int idx) const 
Definition: yateclass.h:5486
void YIGNORE(primitive value)
bool matches(const char *value) const 
UChar(signed char code)
Definition: yateclass.h:1784
Family
Definition: yateclass.h:6075
Mutex support. 
Definition: yateclass.h:5351
unsigned int hash() const 
Definition: yateclass.h:2163
A standard MD5 digest calculator. 
Definition: yateclass.h:4433
RefPointerBase()
Definition: yateclass.h:1079
An abstract data (de)compressor. 
Definition: yateclass.h:8239
String & operator=(const String *value)
Definition: yateclass.h:2356
Engine globals. 
Definition: yatengine.h:1161
Definition: yateclass.h:848
SocketAddr()
Definition: yateclass.h:6095
void debugEnabled(bool enable)
Definition: yateclass.h:349
unsigned int overAlloc() const 
Definition: yateclass.h:4086
String & operator<<(uint32_t value)
Definition: yateclass.h:2513
int getRows() const 
Definition: yateclass.h:1720
bool controlReturn(NamedList *params, bool ret, const char *retVal=0)
static Direction direction(const char *name, Direction defdir=Bidir)
Definition: yateclass.h:8112
String & operator+=(const char *value)
Definition: yateclass.h:2414
Atomic counter with name. 
Definition: yateclass.h:3381
void YCLASS2(class type, class base1, class base2)