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);
713 constant
YSTRING(
const char*
string);
720 constant
YATOM(
const char*
string);
727 void YCLASS(
class type,
class base);
735 void YCLASS2(
class type,
class base1,
class base2);
744 void YCLASS3(
class type,
class base1,
class base2,
class base3);
759 void YCLASSIMP2(
class type,
class base1,
class base2);
768 void YCLASSIMP3(
class type,
class base1,
class base2,
class base3);
785 #define YCLASS(type,base) \
786 public: virtual void* getObject(const String& name) const \
787 { return (name == YATOM(#type)) ? const_cast<type*>(this) : base::getObject(name); }
789 #define YCLASS2(type,base1,base2) \
790 public: virtual void* getObject(const String& name) const \
791 { if (name == YATOM(#type)) return const_cast<type*>(this); \
792 void* tmp = base1::getObject(name); \
793 return tmp ? tmp : base2::getObject(name); }
795 #define YCLASS3(type,base1,base2,base3) \
796 public: virtual void* getObject(const String& name) const \
797 { if (name == YATOM(#type)) return const_cast<type*>(this); \
798 void* tmp = base1::getObject(name); \
799 if (tmp) return tmp; \
800 tmp = base2::getObject(name); \
801 return tmp ? tmp : base3::getObject(name); }
803 #define YCLASSIMP(type,base) \
804 void* type::getObject(const String& name) const \
805 { return (name == YATOM(#type)) ? const_cast<type*>(this) : base::getObject(name); }
807 #define YCLASSIMP2(type,base1,base2) \
808 void* type::getObject(const String& name) const \
809 { if (name == YATOM(#type)) return const_cast<type*>(this); \
810 void* tmp = base1::getObject(name); \
811 return tmp ? tmp : base2::getObject(name); }
813 #define YCLASSIMP3(type,base1,base2,base3) \
814 void* type::getObject(const String& name) const \
815 { if (name == YATOM(#type)) return const_cast<type*>(this); \
816 void* tmp = base1::getObject(name); \
817 if (tmp) return tmp; \
818 tmp = base2::getObject(name); \
819 return tmp ? tmp : base3::getObject(name); }
821 #define YOBJECT(type,pntr) (static_cast<type*>(GenObject::getObject(YATOM(#type),pntr)))
823 #define YNOCOPY(type) private: \
825 void operator=(const type&)
851 virtual bool alive()
const;
864 virtual const String& toString()
const;
871 virtual void* getObject(
const String& name)
const;
880 {
return obj ? obj->
getObject(name) : 0; }
887 {
return s_counting; }
894 { s_counting = enable; }
901 {
return m_counter; }
922 static ObjList& getObjCounters();
926 static bool s_counting;
944 {
if (obj) { obj->destruct(); obj = 0; } }
970 virtual void* getObject(
const String& name)
const;
978 virtual bool alive()
const;
1001 {
return m_refcount; }
1015 {
return obj && (obj->
refcount() > 0); }
1022 static bool efficientIncDec();
1030 virtual void zeroRefs();
1044 virtual void destroyed();
1090 {
return static_cast<Obj*
>(
m_pointer); }
1137 {
assign(
object);
return *
this; }
1143 inline operator Obj*()
const
1198 { m_pointer = value;
return *
this; }
1204 { m_pointer = object;
return *
this; }
1210 inline operator Obj*()
const
1211 {
return m_pointer; }
1217 {
return m_pointer; }
1223 {
return *m_pointer; }
1249 virtual void* getObject(
const String& name)
const;
1255 unsigned int length()
const;
1261 unsigned int count()
const;
1323 {
return at(index); }
1331 {
return at(index); }
1366 int index(
const String& str)
const;
1430 {
return m_delete; }
1437 { m_delete = autodelete; }
1443 static const ObjList& empty();
1457 void sort(
int (*callbackCompare)(
GenObject* obj1,
GenObject* obj2,
void* context),
void* context = 0);
1477 : m_length(0), m_objects(0), m_delete(autodelete)
1485 ObjVector(
unsigned int maxLen,
bool autodelete =
true);
1494 ObjVector(
ObjList& list,
bool move =
true,
unsigned int maxLen = 0,
bool autodelete =
true);
1506 virtual void* getObject(
const String& name)
const;
1513 {
return m_length; }
1519 unsigned int count()
const;
1533 {
return (index >= 0 && index < (
int)m_length) ? m_objects[index] : 0; }
1541 {
return at(index); }
1549 {
return at(index); }
1558 unsigned int assign(
ObjList& list,
bool move =
true,
unsigned int maxLen = 0);
1573 bool set(
GenObject* obj,
unsigned int index);
1587 int index(
const String& str)
const;
1599 {
return m_delete; }
1606 { m_delete = autodelete; }
1609 unsigned int m_length;
1630 explicit Array(
int columns = 0,
int rows = 0);
1642 virtual void* getObject(
const String& name)
const;
1650 bool addRow(
ObjList* row = 0,
int index = -1);
1658 bool addColumn(
ObjList* column = 0,
int index = -1);
1665 bool delRow(
int index);
1672 bool delColumn(
int index);
1680 GenObject*
get(
int column,
int row)
const;
1697 bool set(
GenObject* obj,
int column,
int row);
1711 {
return m_columns; }
1721 if (column >= 0 || column < m_columns)
1722 return static_cast<ObjList*
>(m_obj[column]);
1733 class StringMatchPrivate;
1751 inline explicit UChar(uint32_t code = 0)
1760 : m_chr((code < 0) ? 0 : code)
1768 : m_chr((unsigned char)code)
1775 inline explicit UChar(
unsigned char code)
1785 { m_chr = code; encode();
return *
this; }
1793 { m_chr = (
unsigned char)code; encode();
return *
this; }
1813 inline operator const char*()
const
1823 bool decode(
const char*& str, uint32_t maxChar = 0x10ffff,
bool overlong =
false);
1833 bool decode(uint16_t*& buff,
unsigned int& len, Endianness order, uint32_t maxChar = 0x10ffff);
1842 bool decode(
DataBlock& buff, Endianness order, uint32_t maxChar = 0x10ffff);
1851 bool encode(uint16_t*& buff,
unsigned int& len, Endianness order);
1859 bool encode(
DataBlock& buff, Endianness order);
1871 static bool decode(
String& out, uint16_t*& buff,
unsigned int& len, Endianness order,
bool checkBOM =
false, uint32_t maxChar = 0x10ffff);
1881 static bool encode(
DataBlock& out,
const char*& str, Endianness order,
bool addBOM =
false);
1892 static bool encode(uint16_t*& buff,
unsigned int& len,
const char*& str, Endianness order,
bool addBOM =
false);
1926 String(
const char* value,
int len = -1);
1933 explicit String(
char value,
unsigned int repeat = 1);
1939 explicit String(int32_t value);
1945 explicit String(uint32_t value);
1951 explicit String(int64_t value);
1957 explicit String(uint64_t value);
1963 explicit String(
bool value);
1969 explicit String(
double value);
1993 virtual void* getObject(
const String& name)
const;
1999 static const String& empty();
2007 {
return value ?
"true" :
"false"; }
2014 {
return m_string; }
2021 {
return m_string ? m_string :
""; }
2028 inline const char*
safe(
const char* defStr)
const
2029 {
return m_string ? m_string : (defStr ? defStr :
""); }
2036 {
return m_length; }
2043 {
return !m_string; }
2052 static int lenUtf8(
const char* value, uint32_t maxChar = 0x10ffff,
bool overlong =
false);
2060 inline int lenUtf8(uint32_t maxChar = 0x10ffff,
bool overlong =
false)
const
2061 {
return lenUtf8(m_string,maxChar,overlong); }
2071 int fixUtf8(
const char* replace = 0, uint32_t maxChar = 0x10ffff,
bool overlong =
false);
2079 {
return str && (str[0] ==
'\357') && (str[1] ==
'\273') && (str[2] ==
'\277'); }
2086 {
return checkBOM(
c_str()); }
2094 {
return checkBOM(str) && (str += 3); }
2102 {
return checkBOM(str) && (str += 3); }
2109 {
return checkBOM(
c_str()) && &(*
this =
c_str() + 3); }
2117 if (m_hash == YSTRING_INIT_HASH)
2118 m_hash = hash(m_string);
2128 static unsigned int hash(
const char* value,
unsigned int h = 0);
2140 char at(
int index)
const;
2148 String substr(
int offs,
int len = -1)
const;
2165 virtual const String& toString()
const;
2177 int toInteger(
int defvalue = 0,
int base = 0,
int minvalue = INT_MIN,
2178 int maxvalue = INT_MAX,
bool clamp =
true)
const;
2187 int toInteger(
const TokenDict* tokens,
int defvalue = 0,
int base = 0)
const;
2199 long int toLong(
long int defvalue = 0,
int base = 0,
long int minvalue = LONG_MIN,
2200 long int maxvalue = LONG_MAX,
bool clamp =
true)
const;
2212 int64_t toInt64(int64_t defvalue = 0,
int base = 0, int64_t minvalue = LLONG_MIN,
2213 int64_t maxvalue = LLONG_MAX,
bool clamp =
true)
const;
2220 double toDouble(
double defvalue = 0.0)
const;
2227 bool toBoolean(
bool defvalue =
false)
const;
2233 bool isBoolean()
const;
2253 {
return at(index); }
2261 {
return at(index); }
2267 inline operator const char*()
const
2268 {
return m_string; };
2276 String& assign(
const char* value,
int len = -1);
2284 String& assign(
char value,
unsigned int repeat = 1);
2294 String& hexify(
void* data,
unsigned int len,
char sep = 0,
bool upCase =
false);
2301 {
return operator=(value.
c_str()); }
2309 {
return operator=(value ? value->
c_str() :
""); }
2316 String& operator=(
const char* value);
2322 String& operator=(
char value);
2328 String& operator=(int32_t value);
2334 String& operator=(uint32_t value);
2340 String& operator=(int64_t value);
2346 String& operator=(uint64_t value);
2353 {
return operator=(boolText(value)); }
2359 String& operator=(
double value);
2367 {
return append(value,-1); }
2373 String& operator+=(
char value);
2379 String& operator+=(int32_t value);
2385 String& operator+=(uint32_t value);
2391 String& operator+=(int64_t value);
2397 String& operator+=(uint64_t value);
2404 {
return operator+=(boolText(value)); }
2410 String& operator+=(
double value);
2415 bool operator==(
const char* value)
const;
2420 bool operator!=(
const char* value)
const;
2426 {
return (
this == &value) || ((hash() == value.
hash()) &&
operator==(value.
c_str())); }
2432 {
return (
this != &value) && ((hash() != value.
hash()) ||
operator!=(value.
c_str())); }
2437 bool operator&=(
const char* value)
const;
2442 bool operator|=(
const char* value)
const;
2448 {
return operator+=(value); }
2454 {
return operator+=(value); }
2460 {
return operator+=(value); }
2466 {
return operator+=(value); }
2472 {
return operator+=(value); }
2478 {
return operator+=(value); }
2484 {
return operator+=(value); }
2490 {
return operator+=(value); }
2496 String& operator>>(
const char* skip);
2501 String& operator>>(
char& store);
2511 String& operator>>(
int& store);
2516 String& operator>>(
unsigned int& store);
2521 String& operator>>(
bool& store);
2529 String& append(
const char* value,
int len);
2537 String& append(
const char* value,
const char* separator = 0,
bool force =
false);
2545 String& append(
const ObjList* list,
const char* separator = 0,
bool force =
false);
2554 {
return append(&list,separator,force); }
2561 String& append(
double value,
unsigned int decimals = 3);
2568 String& printf(
const char* format, ...) FORMAT_CHECK(2);
2575 String& printf(
unsigned int length, const
char* format, ...) FORMAT_CHECK(3);
2585 String& appendFixed(
unsigned int fixedLength, const
char* str,
unsigned int len = -1,
char fill = ' ',
int align = Left);
2594 inline
String& appendFixed(
unsigned int fixedLength, const
String& str,
char fill = ' ',
int align = Left)
2595 {
return appendFixed(fixedLength,str.c_str(),str.length(),fill,align); }
2603 int find(
char what,
unsigned int offs = 0)
const;
2611 int find(
const char* what,
unsigned int offs = 0)
const;
2618 int rfind(
char what)
const;
2625 int rfind(
const char* what)
const;
2634 bool startsWith(
const char* what,
bool wordBreak =
false,
bool caseInsensitive =
false)
const;
2643 bool endsWith(
const char* what,
bool wordBreak =
false,
bool caseInsensitive =
false)
const;
2656 bool startSkip(
const char* what,
bool wordBreak =
true,
bool caseInsensitive =
false);
2672 String& extractTo(
const char* sep,
bool& store);
2681 String& extractTo(
const char* sep,
int& store,
int base = 0);
2691 String& extractTo(
const char* sep,
int& store,
const TokenDict* tokens,
int base = 0);
2699 String& extractTo(
const char* sep,
double& store);
2707 {
return operator==(value); }
2714 bool matches(
const Regexp& rexp);
2721 int matchOffset(
int index = 0)
const;
2728 int matchLength(
int index = 0)
const;
2736 {
return substr(matchOffset(index),matchLength(index)); }
2749 int matchCount()
const;
2757 ObjList* split(
char separator,
bool emptyOK =
true)
const;
2765 static String msgEscape(
const char* str,
char extraEsc = 0);
2773 {
return msgEscape(
c_str(),extraEsc); }
2782 static String msgUnescape(
const char* str,
int* errptr = 0,
char extraEsc = 0);
2791 {
return msgUnescape(
c_str(),errptr,extraEsc); }
2799 static String sqlEscape(
const char* str,
char extraEsc = 0);
2807 {
return sqlEscape(
c_str(),extraEsc); }
2816 static String uriEscape(
const char* str,
char extraEsc = 0,
const char* noEsc = 0);
2825 static String uriEscape(
const char* str,
const char* extraEsc,
const char* noEsc = 0);
2834 {
return uriEscape(
c_str(),extraEsc,noEsc); }
2842 static String uriUnescape(
const char* str,
int* errptr = 0);
2850 {
return uriUnescape(
c_str(),errptr); }
2858 static const String* atom(
const String*& str,
const char* val);
2864 virtual void changed();
2867 void clearMatches();
2869 unsigned int m_length;
2871 mutable unsigned int m_hash;
2872 StringMatchPrivate* m_matches;
2881 {
return str ? str->
c_str() : (
const char*)0; }
2889 {
return str ? str :
""; }
2897 {
return str ? str->
safe() :
""; }
2905 {
return !(str && *str); }
2913 {
return !str || str->
null(); }
2918 YATE_API String
operator+(
const String& s1,
const String& s2);
2923 YATE_API String
operator+(
const String& s1,
const char* s2);
2928 YATE_API String
operator+(
const char* s1,
const String& s2);
2935 { dest = src;
return dest.
c_str(); }
2942 { dest += src;
return dest.
c_str(); }
2952 YATE_API
int lookup(
const char* str,
const TokenDict* tokens,
int defvalue = 0,
int base = 0);
2960 YATE_API
const char*
lookup(
int value,
const TokenDict* tokens,
const char* defvalue = 0);
2971 YATE_API
bool controlReturn(NamedList* params,
bool ret,
const char* retVal = 0);
2992 explicit Regexp(
const char* value,
bool extended =
false,
bool insensitive =
false);
3016 {
return m_regexp || (m_compile && doCompile()); }
3023 bool matches(
const char* value)
const;
3038 void setFlags(
bool extended,
bool insensitive);
3044 bool isExtended()
const;
3050 bool isCaseInsensitive()
const;
3056 virtual void changed();
3062 bool doCompile()
const;
3066 bool matches(
const char* value, StringMatchPrivate* matchlist)
const;
3067 mutable void* m_regexp;
3068 mutable bool m_compile;
3083 inline explicit Atom(
const char* value)
3120 :
String(text), m_level(level)
3128 :
String(original), m_level(original.level())
3144 {
return s_capturing; }
3151 {
return s_events; }
3158 inline static void append(
int level,
const char* text)
3159 {
if (text && *text) s_events.append(
new CapturedEvent(level,text)); }
3167 {
return s_events; }
3174 { s_capturing = capture; }
3179 static bool s_capturing;
3195 explicit NamedString(
const char* name,
const char* value = 0);
3208 virtual const String& toString()
const;
3215 virtual void* getObject(
const String& name)
const;
3277 {
return m_data ? m_data->getObject(name) : 0; }
3290 virtual void* getObject(
const String& name)
const;
3296 virtual void changed();
3322 {
return m_enabled; }
3329 { m_enabled = val; }
3371 explicit HashList(
unsigned int size = 17);
3383 virtual void* getObject(
const String& name)
const;
3396 unsigned int count()
const;
3405 {
return (index < m_size) ? m_lists[index] : 0; }
3413 {
return getList(hash % m_size); }
3421 {
return getHashList(str.
hash()); }
3478 return n ? n->
remove(delobj) : 0;
3502 unsigned int m_size;
3542 {
return m_length; }
3554 void assign(
ObjList& list,
int offset = 0);
3561 void assign(
HashList& list,
int offset = 0);
3569 GenObject*
get(
unsigned int index)
const;
3590 {
return m_current >= m_length; }
3602 unsigned int* m_hashes;
3603 unsigned int m_length;
3604 unsigned int m_current;
3633 inline explicit Time(
const struct timeval* tv)
3634 : m_time(fromTimeval(tv))
3641 inline explicit Time(
const struct timeval& tv)
3642 : m_time(fromTimeval(tv))
3657 {
return (u_int32_t)((m_time+500000) / 1000000); }
3664 {
return (m_time+500) / 1000; }
3676 inline operator u_int64_t()
const
3683 { m_time = usec;
return *
this; }
3689 { m_time += delta;
return *
this; }
3695 { m_time -= delta;
return *
this; }
3702 { toTimeval(tv, m_time); }
3709 static void toTimeval(
struct timeval* tv, u_int64_t usec);
3716 static u_int64_t fromTimeval(
const struct timeval* tv);
3724 {
return fromTimeval(&tv); }
3730 static u_int64_t now();
3736 static u_int64_t msecNow();
3742 static u_int32_t secNow();
3757 static unsigned int toEpoch(
int year,
unsigned int month,
unsigned int day,
3758 unsigned int hour,
unsigned int minute,
unsigned int sec,
int offset = 0);
3772 static bool toDateTime(
unsigned int epochTimeSec,
int& year,
unsigned int& month,
3773 unsigned int& day,
unsigned int& hour,
unsigned int& minute,
unsigned int& sec,
3774 unsigned int* wDay = 0);
3782 {
return (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)); }
3788 static int timeZone();
3813 inline u_int32_t
get()
const
3814 {
return m_random; }
3820 inline void set(u_int32_t seed)
3821 { m_random = seed; }
3833 static long int random();
3839 static void srandom(
unsigned int seed);
3879 DataBlock(
void* value,
unsigned int len,
bool copyData =
true,
unsigned int overAlloc = 0);
3891 virtual void* getObject(
const String& name)
const;
3911 inline unsigned char*
data(
unsigned int offs,
unsigned int len = 1)
const
3912 {
return (offs + len <= m_length) ? (
static_cast<unsigned char*
>(m_data) + offs) : 0; }
3920 inline int at(
unsigned int offs,
int defvalue = -1)
const
3921 {
return (offs < m_length) ?
static_cast<unsigned char*
>(m_data)[offs] : defvalue; }
3935 {
return m_length; }
3942 {
return m_overAlloc; }
3949 { m_overAlloc = bytes; }
3955 void clear(
bool deleteData =
true);
3964 DataBlock& assign(
void* value,
unsigned int len,
bool copyData =
true,
unsigned int allocated = 0);
3971 inline void append(
void* value,
unsigned int len) {
3987 void append(
const String& value);
4000 if (len != length())
4008 void truncate(
unsigned int len);
4022 {
return at(index); }
4030 {
return at(index); }
4041 { append(value);
return *
this; }
4047 { append(value);
return *
this; }
4058 const String& dFormat,
unsigned maxlen = 0);
4070 bool unHexify(
const char* data,
unsigned int len,
char sep);
4081 bool unHexify(
const char* data,
unsigned int len);
4097 String sqlEscape(
char extraEsc)
const;
4100 unsigned int allocLen(
unsigned int len)
const;
4102 unsigned int m_length;
4103 unsigned int m_allocated;
4104 unsigned int m_overAlloc;
4122 virtual void clear() = 0;
4128 virtual void finalize() = 0;
4135 virtual const unsigned char* rawDigest() = 0;
4143 { finalize();
return m_hex; }
4151 inline bool update(
const void* buf,
unsigned int len)
4152 {
return updateInternal(buf,len); }
4160 {
return updateInternal(data.
data(), data.
length()); }
4168 {
return updateInternal(str.
c_str(), str.
length()); }
4175 { update(value);
return *
this; }
4182 { update(data);
return *
this; }
4197 bool hmacStart(
DataBlock& opad,
const void* key,
unsigned int keyLen);
4206 {
return hmacStart(opad,key.
data(),key.
length()); }
4215 {
return hmacStart(opad,key.
c_str(),key.
length()); }
4232 bool hmac(
const void* key,
unsigned int keyLen,
const void* msg,
unsigned int msgLen);
4256 virtual unsigned int hashLength()
const = 0;
4262 virtual unsigned int hmacBlockSize()
const;
4278 virtual bool updateInternal(
const void* buf,
unsigned int len) = 0;
4300 MD5(
const MD5& original);
4307 MD5(
const void* buf,
unsigned int len);
4324 MD5& operator=(
const MD5& original);
4334 virtual void clear();
4340 virtual void finalize();
4347 virtual const unsigned char* rawDigest();
4364 bool updateInternal(
const void* buf,
unsigned int len);
4368 unsigned char m_bin[16];
4394 SHA1(
const void* buf,
unsigned int len);
4411 SHA1& operator=(
const SHA1& original);
4421 virtual void clear();
4427 virtual void finalize();
4434 virtual const unsigned char* rawDigest();
4461 bool updateInternal(
const void* buf,
unsigned int len);
4465 unsigned char m_bin[20];
4491 SHA256(
const void* buf,
unsigned int len);
4518 virtual void clear();
4524 virtual void finalize();
4531 virtual const unsigned char* rawDigest();
4548 bool updateInternal(
const void* buf,
unsigned int len);
4552 unsigned char m_bin[32];
4575 inline Base64(
void* src,
unsigned int len,
bool copyData =
true)
4588 void encode(
String& dest,
unsigned int lineLen = 0,
bool lineAtEnd =
false);
4601 bool decode(
DataBlock& dest,
bool liberal =
true);
4607 { append(value);
return *
this; }
4613 { append(data);
return *
this; }
4622 class NamedIterator;
4664 virtual void* getObject(
const String& name)
const;
4671 {
return m_params.length(); }
4678 {
return m_params.count(); }
4684 { m_params.clear(); }
4700 NamedList& addParam(
const char* name,
const char* value,
bool emptyOK =
true);
4710 m_params.setUnique(param);
4781 bool skipPrefix =
true,
bool replace =
false);
4788 bool hasSubParams(
const char* prefix)
const;
4802 int getIndex(
const String& name)
const;
4831 const char* getValue(
const String& name,
const char* defvalue = 0)
const;
4843 int getIntValue(
const String& name,
int defvalue = 0,
int minvalue = INT_MIN,
4844 int maxvalue = INT_MAX,
bool clamp =
true)
const;
4853 int getIntValue(
const String& name,
const TokenDict* tokens,
int defvalue = 0)
const;
4865 int64_t getInt64Value(
const String& name, int64_t defvalue = 0, int64_t minvalue = LLONG_MIN,
4866 int64_t maxvalue = LLONG_MAX,
bool clamp =
true)
const;
4874 double getDoubleValue(
const String& name,
double defvalue = 0.0)
const;
4882 bool getBoolValue(
const String& name,
bool defvalue =
false)
const;
4891 int replaceParams(
String& str,
bool sqlEsc =
false,
char extraEsc = 0)
const;
4901 void dump(
String& str,
const char* separator,
char quote = 0,
bool force =
false)
const;
4914 {
return &m_params; }
4921 {
return &m_params; }
4941 : m_list(&list), m_item(list.m_params.skipNull())
4949 : m_list(original.m_list), m_item(original.m_item)
4957 { m_list = &list; m_item = list.m_params.
skipNull();
return *
this; }
4964 { m_list = original.m_list; m_item = original.m_item;
return *
this; }
4982 { m_item = m_list->m_params.skipNull(); }
5019 explicit URI(
const char* uri);
5029 URI(
const char* proto,
const char* user,
const char* host,
int port = 0,
const char* desc = 0);
5062 { parse();
return m_desc; }
5069 { parse();
return m_proto; }
5076 { parse();
return m_user; }
5083 { parse();
return m_host; }
5090 { parse();
return m_port; }
5097 { parse();
return m_extra; }
5105 virtual void changed();
5106 mutable bool m_parsed;
5116 class SemaphorePrivate;
5117 class ThreadPrivate;
5136 virtual bool lock(
long maxwait = -1) = 0;
5142 virtual bool unlock() = 0;
5149 virtual bool locked()
const = 0;
5156 virtual bool check(
long maxwait = -1);
5164 virtual bool unlockAll();
5171 static void wait(
unsigned long maxwait);
5177 static unsigned long wait();
5185 static void startUsingNow();
5193 static void enableSafety(
bool safe =
true);
5199 static bool safety();
5208 friend class MutexPrivate;
5216 explicit Mutex(
bool recursive =
false,
const char* name = 0);
5240 virtual bool lock(
long maxwait = -1);
5246 virtual bool unlock();
5253 virtual bool locked()
const;
5259 const char* owner()
const;
5265 bool recursive()
const;
5283 static bool efficientTimedLock();
5286 MutexPrivate* privDataCopy()
const;
5287 MutexPrivate* m_private;
5309 MutexPool(
unsigned int len = 13,
bool recursive =
false,
const char* name = 0);
5323 inline unsigned int index(
void* ptr)
const
5324 {
return ((
unsigned int)(
unsigned long)ptr) % m_length; }
5334 {
return m_data[index(ptr)]; }
5342 {
return m_data[idx % m_length]; }
5347 unsigned int m_length;
5356 friend class SemaphorePrivate;
5364 explicit Semaphore(
unsigned int maxcount = 1,
const char* name = 0,
5365 unsigned int initialCount = 1);
5389 virtual bool lock(
long maxwait = -1);
5395 virtual bool unlock();
5402 virtual bool locked()
const;
5420 static bool efficientTimedLock();
5423 SemaphorePrivate* privDataCopy()
const;
5424 SemaphorePrivate* m_private;
5442 { m_lock = lck.
lock(maxwait) ? &lck : 0; }
5450 { m_lock = (lck && lck->
lock(maxwait)) ? lck : 0; }
5456 {
if (m_lock) m_lock->unlock(); }
5469 {
if (m_lock) m_lock->unlock(); m_lock = 0; }
5478 {
return (lck && (lck == m_lock)) ||
5479 (drop(),(lck && (m_lock = lck->
lock(maxwait) ? lck : 0))); }
5488 {
return acquire(&lck,maxwait); }
5494 inline void*
operator new(size_t);
5497 inline void*
operator new[](size_t);
5517 : m_mx1(0), m_mx2(0)
5518 { lock(mx1,mx2,maxwait); }
5527 : m_mx1(0), m_mx2(0)
5528 { lock(&mx1,&mx2,maxwait); }
5541 {
return m_mx1 != 0; }
5550 bool lock(
Mutex* mx1,
Mutex* mx2,
long maxwait = -1);
5560 {
return lock(&mx1,&mx2,maxwait); }
5572 inline void*
operator new(size_t);
5575 inline void*
operator new[](size_t);
5590 virtual void run() = 0;
5606 friend class ThreadPrivate;
5607 friend class MutexPrivate;
5608 friend class SemaphorePrivate;
5625 virtual void cleanup();
5643 bool running()
const;
5657 {
return m_locking || m_locks; }
5663 const char* name()
const;
5669 static const char* currentName();
5676 static void yield(
bool exitCheck =
false);
5683 static void idle(
bool exitCheck =
false);
5690 static void sleep(
unsigned int sec,
bool exitCheck =
false);
5697 static void msleep(
unsigned long msec,
bool exitCheck =
false);
5705 static void usleep(
unsigned long usec,
bool exitCheck =
false);
5711 static unsigned long idleUsec();
5717 static unsigned long idleMsec();
5723 static void idleMsec(
unsigned long msec);
5730 static Thread* current();
5743 static bool check(
bool exitNow =
true);
5754 void cancel(
bool hard =
false);
5761 {
return current() ==
this; }
5781 static NamedCounter* getCurrentObjCounter(
bool always =
false);
5796 static Priority priority(
const char* name, Priority defvalue = Normal);
5803 static const char* priority(Priority prio);
5809 static void killall();
5815 static void preExec();
5822 static int lastError();
5831 {
return errorString(buffer,lastError()); }
5843 static bool errorString(
String& buffer,
int code);
5851 Thread(
const char *name = 0, Priority prio = Normal);
5858 Thread(
const char *name,
const char* prio);
5866 ThreadPrivate* m_private;
5885 : m_saved(0), m_enabled(enable)
5894 : m_saved(0), m_enabled(enable && obj)
5903 : m_saved(0), m_enabled(enable)
5931 Unknown = AF_UNSPEC,
5934 AfUnsupported = AfMax,
5938 IPv6 = AfUnsupported + 1,
5943 Unix = AfUnsupported + 2,
5951 : m_address(0), m_length(0)
5960 m_address(0), m_length(0)
5968 explicit SocketAddr(
int family,
const void* raw = 0);
5975 SocketAddr(
const struct sockaddr* addr, socklen_t len = 0);
5994 bool operator==(
const SocketAddr& other)
const;
6002 {
return !operator==(other); }
6014 bool assign(
int family);
6021 void assign(
const struct sockaddr* addr, socklen_t len = 0);
6042 {
return m_length && m_address; }
6049 {
return !(m_length && m_address); }
6056 {
return m_address ? m_address->sa_family : 0; }
6063 {
return lookupFamily(family()); }
6070 {
return scopeId(address()); }
6078 {
return scopeId(address(),val); }
6103 virtual bool host(
const String& name);
6116 bool port(
int newport);
6123 {
return m_address; }
6130 {
return m_length; }
6137 {
return isNullAddr(m_host,family()); }
6151 static bool supports(
int family);
6158 static int family(
const String& addr);
6166 static bool stringify(
String& buf,
struct sockaddr* addr);
6177 int family = Unknown) {
6179 return sa.
host(host) ? copyAddr(buf,sa.
address()) : Unknown;
6189 static int copyAddr(uint8_t* buf,
struct sockaddr* addr);
6196 static inline unsigned int scopeId(
struct sockaddr* addr) {
6198 if (addr && addr->sa_family == AF_INET6)
6199 return ((
struct sockaddr_in6*)addr)->sin6_scope_id;
6210 static inline bool scopeId(
struct sockaddr* addr,
unsigned int val) {
6212 if (addr && addr->sa_family == AF_INET6) {
6213 ((
struct sockaddr_in6*)addr)->sin6_scope_id = val;
6238 int family = Unknown) {
6239 appendAddr(buf,addr,family) <<
":" << port;
6252 appendTo(buf,addr,port,family);
6262 static bool isNullAddr(
const String& addr,
int family = Unknown);
6285 static void split(
const String& buf,
String& addr,
int& port,
bool portPresent =
false);
6293 {
return lookup(family,s_familyName); }
6299 static const String& ipv4NullAddr();
6305 static const String& ipv6NullAddr();
6311 static const TokenDict* dictFamilyName();
6317 virtual void stringify();
6322 virtual void updateAddr()
const;
6324 struct sockaddr* m_address;
6357 virtual void* getObject(
const String& name)
const;
6363 virtual void timerTick(
const Time& when);
6374 virtual bool received(
void* buffer,
int length,
int flags,
const struct sockaddr* addr, socklen_t adrlen) = 0;
6381 {
return m_socket; }
6425 virtual bool terminate() = 0;
6431 virtual bool canRetry()
const;
6437 virtual bool inProgress()
const;
6443 virtual bool valid()
const = 0;
6450 virtual bool setBlocking(
bool block =
true);
6458 virtual int writeData(
const void* buffer,
int length) = 0;
6465 int writeData(
const char* str);
6481 {
return writeData(buf.
data(), buf.
length()); }
6489 virtual int readData(
void* buffer,
int length) = 0;
6495 virtual int64_t length();
6503 virtual int64_t seek(SeekPos pos, int64_t offset = 0);
6510 inline int64_t
seek(int64_t offset)
6511 {
return seek(SeekBegin,offset); }
6519 static bool allocPipe(
Stream*& reader,
Stream*& writer);
6533 static bool supportsPipes();
6539 static bool supportsPairs();
6578 : m_data(data), m_offset(0)
6607 virtual int writeData(
const void* buffer,
int len);
6615 virtual int readData(
void* buffer,
int len);
6622 {
return m_data.length(); }
6630 virtual int64_t seek(SeekPos pos, int64_t offset = 0);
6661 explicit File(HANDLE handle);
6680 virtual bool openPath(
const char* name,
bool canWrite =
false,
bool canRead =
true,
6681 bool create =
false,
bool append =
false,
bool binary =
false,
6682 bool pubReadable =
false,
bool pubWritable =
false);
6688 virtual bool terminate();
6694 void attach(HANDLE handle);
6707 {
return m_handle; }
6713 virtual bool canRetry()
const;
6719 virtual bool valid()
const;
6725 static HANDLE invalidHandle();
6732 virtual bool setBlocking(
bool block =
true);
6738 virtual int64_t length();
6746 virtual int64_t seek(SeekPos pos, int64_t offset = 0);
6754 virtual int writeData(
const void* buffer,
int length);
6762 virtual int readData(
void* buffer,
int length);
6769 bool getFileTime(
unsigned int& secEpoch);
6777 virtual bool md5(
String& buffer);
6786 static bool setFileTime(
const char* name,
unsigned int secEpoch,
int* error = 0);
6795 static bool getFileTime(
const char* name,
unsigned int& secEpoch,
int* error = 0);
6803 static bool exists(
const char* name,
int* error = 0);
6812 static bool rename(
const char* oldFile,
const char* newFile,
int* error = 0);
6820 static bool remove(
const char* name,
int* error = 0);
6829 static bool md5(
const char* name,
String& buffer,
int* error = 0);
6838 static bool mkDir(
const char* path,
int* error = 0,
int mode = -1);
6846 static bool rmDir(
const char* path,
int* error = 0);
6859 static bool listDirectory(
const char* path,
ObjList* dirs,
ObjList* files,
6868 static bool createPipe(
File& reader,
File& writer);
6893 LowDelay = IPTOS_LOWDELAY,
6894 MaxThroughput = IPTOS_THROUGHPUT,
6895 MaxReliability = IPTOS_RELIABILITY,
6896 MinCost = IPTOS_MINCOST,
6927 ExpeditedFwd = 0xb8,
6940 explicit Socket(SOCKET handle);
6948 Socket(
int domain,
int type,
int protocol = 0);
6962 virtual bool create(
int domain,
int type,
int protocol = 0);
6968 virtual bool terminate();
6974 void attach(SOCKET handle);
6987 {
return m_handle; }
6993 virtual bool canRetry()
const;
6999 virtual bool inProgress()
const;
7005 virtual bool valid()
const;
7011 static SOCKET invalidHandle();
7017 static int socketError();
7033 virtual bool setOption(
int level,
int name,
const void* value = 0, socklen_t length = 0);
7044 #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
7045 int value = on ? 1 : 0;
7046 return setOption(IPPROTO_IPV6,IPV6_V6ONLY,&value,
sizeof(value));
7060 virtual bool getOption(
int level,
int name,
void* buffer, socklen_t* length);
7083 virtual bool setTOS(
int tos);
7091 inline bool setTOS(
const char* tos,
int defTos = Normal)
7092 {
return setTOS(
lookup(tos,tosValues(),defTos)); }
7098 virtual int getTOS();
7105 virtual bool setBlocking(
bool block =
true);
7114 virtual bool setReuse(
bool reuse =
true,
bool exclusive =
false);
7122 virtual bool setLinger(
int seconds = -1);
7130 virtual bool bind(
struct sockaddr* addr, socklen_t addrlen);
7145 virtual bool listen(
unsigned int backlog = 0);
7153 virtual Socket* accept(
struct sockaddr* addr = 0, socklen_t* addrlen = 0);
7168 SOCKET acceptHandle(
struct sockaddr* addr = 0, socklen_t* addrlen = 0);
7183 static bool efficientSelect();
7190 static bool canSelect(SOCKET handle);
7196 virtual bool canSelect()
const;
7204 virtual bool connect(
struct sockaddr* addr, socklen_t addrlen);
7223 virtual bool connectAsync(
struct sockaddr* addr, socklen_t addrlen,
unsigned int toutUs,
7236 {
return connectAsync(addr.
address(),addr.
length(),toutUs,timeout); }
7244 virtual bool shutdown(
bool stopReads,
bool stopWrites);
7252 virtual bool getSockName(
struct sockaddr* addr, socklen_t* addrlen);
7267 virtual bool getPeerName(
struct sockaddr* addr, socklen_t* addrlen);
7285 virtual int sendTo(
const void* buffer,
int length,
const struct sockaddr* addr, socklen_t adrlen,
int flags = 0);
7296 {
return sendTo(buffer, length, addr.
address(), addr.
length(), flags); }
7305 virtual int send(
const void* buffer,
int length,
int flags = 0);
7313 virtual int writeData(
const void* buffer,
int length);
7324 virtual int recvFrom(
void* buffer,
int length,
struct sockaddr* addr = 0, socklen_t* adrlen = 0,
int flags = 0);
7334 int recvFrom(
void* buffer,
int length,
SocketAddr& addr,
int flags = 0);
7343 virtual int recv(
void* buffer,
int length,
int flags = 0);
7351 virtual int readData(
void* buffer,
int length);
7361 virtual bool select(
bool* readok,
bool* writeok,
bool* except,
struct timeval* timeout = 0);
7371 bool select(
bool* readok,
bool* writeok,
bool* except, int64_t timeout);
7385 void removeFilter(
SocketFilter* filter,
bool delobj =
false);
7390 void clearFilters();
7398 virtual void timerTick(
const Time& when);
7407 static bool createPair(
Socket& sock1,
Socket& sock2,
int domain = AF_UNIX);
7422 bool checkError(
int retcode,
bool strict =
false);
7433 bool applyFilters(
void* buffer,
int length,
int flags,
const struct sockaddr* addr = 0, socklen_t adrlen = 0);
7471 virtual bool bindx(
ObjList& addresses) = 0;
7478 virtual bool connectx(
ObjList& addresses) = 0;
7489 virtual int sendTo(
void* buffer,
int length,
int stream,
SocketAddr& addr,
int flags) = 0;
7507 virtual int sendMsg(
const void* buf,
int length,
int stream,
int& flags) = 0;
7518 virtual int recvMsg(
void* buf,
int length,
SocketAddr& addr,
int& stream,
int& flags) = 0;
7526 virtual bool setStreams(
int inbound,
int outbound) = 0;
7533 virtual bool subscribeEvents() = 0;
7541 virtual bool getStreams(
int& inbound,
int& outbound) = 0;
7548 virtual bool setPayload(u_int32_t payload) = 0;
7603 : m_ttl(ttl), m_order(order), m_pref(pref)
7610 : m_order(0), m_pref(0)
7639 virtual void dump(
String& buf,
const char* sep =
" ");
7686 virtual void dump(
String& buf,
const char* sep =
" ");
7719 inline SrvRecord(
int ttl,
int prio,
int weight,
const char* addr,
int port)
7720 :
DnsRecord(ttl,prio,weight), m_address(addr), m_port(port)
7728 {
return m_address; }
7742 virtual void dump(
String& buf,
const char* sep =
" ");
7778 NaptrRecord(
int ttl,
int ord,
int pref,
const char* flags,
const char* serv,
7779 const char* regexp,
const char* next);
7787 bool replace(
String& str)
const;
7794 virtual void dump(
String& buf,
const char* sep =
" ");
7808 {
return m_service; }
7815 {
return m_regmatch; }
7822 {
return m_template; }
7867 static bool available(Type type = Unknown);
7875 static bool init(
int timeout = -1,
int retries = -1);
7885 static int query(Type type,
const char* dname,
ObjList& result,
String* error = 0);
7894 static int srvQuery(
const char* dname,
ObjList& result,
String* error = 0);
7903 static int naptrQuery(
const char* dname,
ObjList& result,
String* error = 0);
7912 static int a4Query(
const char* dname,
ObjList& result,
String* error = 0);
7921 static int a6Query(
const char* dname,
ObjList& result,
String* error = 0);
7930 static int txtQuery(
const char* dname,
ObjList& result,
String* error = 0);
7959 {
return s_directions; }
7980 virtual void* getObject(
const String& name)
const;
7987 virtual bool valid(Direction dir = Bidir)
const;
7993 virtual unsigned int blockSize()
const = 0;
7999 virtual unsigned int initVectorSize()
const;
8006 unsigned int bufferSize(
unsigned int len)
const;
8013 bool bufferFull(
unsigned int len)
const;
8022 virtual bool setKey(
const void* key,
unsigned int len, Direction dir = Bidir) = 0;
8031 {
return setKey(key.
data(),key.
length(),dir); }
8040 virtual bool initVector(
const void* vect,
unsigned int len, Direction dir = Bidir);
8049 {
return initVector(vect.
data(),vect.
length(),dir); }
8058 virtual bool encrypt(
void* outData,
unsigned int len,
const void* inpData = 0) = 0;
8066 {
return encrypt(data.
data(),data.
length()); }
8075 virtual bool decrypt(
void* outData,
unsigned int len,
const void* inpData = 0) = 0;
8083 {
return decrypt(data.
data(),data.
length()); }
8105 :
String(name), m_format(format)
8119 {
return m_format; }
8128 virtual bool init(
bool comp =
true,
bool decomp =
true,
8147 virtual int compress(
const void* buf,
unsigned int len,
DataBlock& dest);
8157 virtual int decompress(
const void* buf,
unsigned int len,
DataBlock& dest);
8169 virtual int writeComp(
const void* buf,
unsigned int len,
bool flush) = 0;
8180 {
return writeComp(data.
data(),data.
length(),flush); }
8191 {
return writeComp(data.
c_str(),data.
length(),flush); }
8199 virtual int readComp(
DataBlock& buf,
bool flush) = 0;
8209 virtual int writeDecomp(
const void* buf,
unsigned int len,
bool flush) = 0;
8219 {
return writeDecomp(data.
data(),data.
length(),flush); }
8229 {
return writeDecomp(data.
c_str(),data.
length(),flush); }
8237 virtual int readDecomp(
DataBlock& buf,
bool flush) = 0;
8269 static u_int64_t startTime();
8276 static u_int64_t usecRunTime(Type type = WallTime);
8283 static u_int64_t msecRunTime(Type type = WallTime);
8290 static u_int32_t secRunTime(Type type = WallTime);
8297 static double runTime(Type type = WallTime);
A Mutex pool.
Definition: yateclass.h:5296
int sendTo(const void *buffer, int length, const SocketAddr &addr, int flags=0)
Definition: yateclass.h:7295
Time & operator=(u_int64_t usec)
Definition: yateclass.h:3682
String & operator+=(bool value)
Definition: yateclass.h:2403
A DNS record.
Definition: yateclass.h:7591
Internal helper class.
Definition: yateclass.h:1056
const char * c_safe(const char *str)
Definition: yateclass.h:2888
int count() const
Definition: yateclass.h:3347
bool null() const
Definition: yateclass.h:2042
Abstract interface for lockable objects.
Definition: yateclass.h:5123
int writeData(const DataBlock &buf)
Definition: yateclass.h:6480
RefPointer(const RefPointer< Obj > &value)
Definition: yateclass.h:1110
const char * debugColor(int level)
Compressor(const char *format, const char *name=0)
Definition: yateclass.h:8104
GenPointer()
Definition: yateclass.h:1174
DataBlock & operator+=(const DataBlock &value)
Definition: yateclass.h:4040
int locks() const
Definition: yateclass.h:5649
GenObject * operator[](unsigned int index) const
Definition: yateclass.h:1548
static bool alive(const RefObject *obj)
Definition: yateclass.h:1014
UChar & operator=(char code)
Definition: yateclass.h:1792
unsigned int index(void *ptr) const
Definition: yateclass.h:5323
void setDelete(bool autodelete)
Definition: yateclass.h:1605
bool hmacStart(DataBlock &opad, const DataBlock &key)
Definition: yateclass.h:4205
const char * c_str() const
Definition: yateclass.h:2013
GenObject * operator[](signed int index) const
Definition: yateclass.h:1540
A class that holds just a block of raw data.
Definition: yateclass.h:3849
ObjList * getList(unsigned int index) const
Definition: yateclass.h:3404
String sqlEscape(char extraEsc=0) const
Definition: yateclass.h:2806
int debugLevel() const
Definition: yateclass.h:328
ObjList * next() const
Definition: yateclass.h:1282
const String & getUser() const
Definition: yateclass.h:5075
u_int32_t sec() const
Definition: yateclass.h:3656
bool isNullAddr() const
Definition: yateclass.h:6136
UChar(uint32_t code=0)
Definition: yateclass.h:1751
Definition: yateclass.h:950
int value
Definition: yateclass.h:692
A regexp matching class.
Definition: yateclass.h:2977
NamedIterator(const NamedList &list)
Definition: yateclass.h:4940
static void setObjCounting(bool enable)
Definition: yateclass.h:893
void Debug(int level, const char *format,...)
static const char * lookupFamily(int family)
Definition: yateclass.h:6292
SOCKET handle() const
Definition: yateclass.h:6986
static unsigned int scopeId(struct sockaddr *addr)
Definition: yateclass.h:6196
A captured event string with a debug level.
Definition: yateclass.h:3109
const char * safe(const char *defStr) const
Definition: yateclass.h:2028
Regexp & operator=(const char *value)
Definition: yateclass.h:3008
String matchString(int index=0) const
Definition: yateclass.h:2735
Mutex * mutex(void *ptr) const
Definition: yateclass.h:5333
GenPointer< Obj > & operator=(Obj *object)
Definition: yateclass.h:1203
RefPointer()
Definition: yateclass.h:1103
String & operator<<(int64_t value)
Definition: yateclass.h:2471
SocketAddr & operator=(const SocketAddr &value)
Definition: yateclass.h:5986
~Lock2()
Definition: yateclass.h:5533
GenObject * operator[](unsigned int index) const
Definition: yateclass.h:1330
GenPointer< Obj > & operator=(const GenPointer< Obj > &value)
Definition: yateclass.h:1197
ObjList * skipNull() const
A NAPTR record.
Definition: yateclass.h:7763
void toTimeval(struct timeval *tv) const
Definition: yateclass.h:3701
bool eof() const
Definition: yateclass.h:3589
static bool capturing()
Definition: yateclass.h:3143
MemoryStream()
Definition: yateclass.h:6569
bool decrypt(DataBlock &data)
Definition: yateclass.h:8082
uint32_t code() const
Definition: yateclass.h:1799
virtual bool init(bool comp=true, bool decomp=true, const NamedList ¶ms=NamedList::empty())
Definition: yateclass.h:8128
bool connectAsync(const SocketAddr &addr, unsigned int toutUs, bool *timeout=0)
Definition: yateclass.h:7234
A filter for received socket data.
Definition: yateclass.h:6337
const String & hexDigest()
Definition: yateclass.h:4142
const char * strcat(String &dest, const char *src)
Definition: yateclass.h:2941
const String & format() const
Definition: yateclass.h:8118
NamedIterator & operator=(const NamedList &list)
Definition: yateclass.h:4956
const String & address() const
Definition: yateclass.h:7727
bool autoDelete()
Definition: yateclass.h:1429
UChar(int32_t code)
Definition: yateclass.h:1759
Formatting
Definition: yateclass.h:576
virtual ~GenObject()
Definition: yateclass.h:843
static void append(int level, const char *text)
Definition: yateclass.h:3158
Thread support class.
Definition: yateclass.h:5604
bool update(const String &str)
Definition: yateclass.h:4167
bool locked() const
Definition: yateclass.h:5656
const String & getExtra() const
Definition: yateclass.h:5096
~Lock()
Definition: yateclass.h:5455
int writeDecomp(const String &data, bool flush)
Definition: yateclass.h:8228
SeekPos
Definition: yateclass.h:6403
constant YSTRING(const char *string)
A stream file class.
Definition: yateclass.h:6648
bool hmac(const String &key, const String &msg)
Definition: yateclass.h:4249
static int unStringify(uint8_t *buf, const String &host, int family=Unknown)
Definition: yateclass.h:6176
const Regexp & regexp() const
Definition: yateclass.h:7814
RefPointer< Obj > & operator=(const RefPointer< Obj > &value)
Definition: yateclass.h:1130
static const char * boolText(bool value)
Definition: yateclass.h:2006
bool lock(Mutex &mx1, Mutex &mx2, long maxwait=-1)
Definition: yateclass.h:5559
Stream()
Definition: yateclass.h:6545
unsigned int length() const
Definition: yateclass.h:4670
static bool getObjCounting()
Definition: yateclass.h:886
bool null() const
Definition: yateclass.h:6048
void enable(bool val)
Definition: yateclass.h:3328
String uriEscape(char extraEsc=0, const char *noEsc=0) const
Definition: yateclass.h:2833
bool compile() const
Definition: yateclass.h:3015
bool checkBOM() const
Definition: yateclass.h:2085
bool hmac(const DataBlock &key, const DataBlock &msg)
Definition: yateclass.h:4240
const String & flags() const
Definition: yateclass.h:7800
Socket * socket() const
Definition: yateclass.h:6380
virtual unsigned int hashLength() const
Definition: yateclass.h:4544
Lock(Lockable &lck, long maxwait=-1)
Definition: yateclass.h:5441
An abstract cipher.
Definition: yateclass.h:7942
virtual unsigned int hashLength() const
Definition: yateclass.h:4447
~RefPointer()
Definition: yateclass.h:1124
unsigned int length() const
Definition: yateclass.h:3389
u_int64_t msec() const
Definition: yateclass.h:3663
ObjList * getColumn(int column) const
Definition: yateclass.h:1720
Time()
Definition: yateclass.h:3617
SocketRef(Socket *&socket)
Definition: yateclass.h:7570
unsigned char * data(unsigned int offs, unsigned int len=1) const
Definition: yateclass.h:3911
void XDebug(int level, const char *format,...)
static unsigned int rawLength()
Definition: yateclass.h:4440
Base64(void *src, unsigned int len, bool copyData=true)
Definition: yateclass.h:4575
String & operator<<(const char *value)
Definition: yateclass.h:2447
bool connect(const SocketAddr &addr)
Definition: yateclass.h:7211
int port() const
Definition: yateclass.h:7734
Obj * pointer() const
Definition: yateclass.h:1089
String uriUnescape(int *errptr=0) const
Definition: yateclass.h:2849
~Time()
Definition: yateclass.h:3649
A socket address holder.
Definition: yateclass.h:5923
ObjVector(bool autodelete=true)
Definition: yateclass.h:1476
static u_int64_t fromTimeval(const struct timeval &tv)
Definition: yateclass.h:3723
bool debugChained() const
Definition: yateclass.h:370
void resize(unsigned int len)
Definition: yateclass.h:3999
int order() const
Definition: yateclass.h:7624
URI & operator=(const char *value)
Definition: yateclass.h:5054
const String & name() const
Definition: yateclass.h:3201
SocketRef(Socket **socket)
Definition: yateclass.h:7562
static const String * atom(const String *&str, const char *val)
String & operator<<(uint64_t value)
Definition: yateclass.h:2477
const char * debugName() const
Definition: yateclass.h:356
virtual int64_t length()
Definition: yateclass.h:6621
virtual ~Compressor()
Definition: yateclass.h:8111
String & operator<<(double value)
Definition: yateclass.h:2489
A list based Array.
Definition: yateclass.h:1622
MemoryStream(const DataBlock &data)
Definition: yateclass.h:6577
bool bind(const SocketAddr &addr)
Definition: yateclass.h:7137
unsigned int length() const
Definition: yateclass.h:3541
virtual void * getObject(const String &name) const
SrvRecord(int ttl, int prio, int weight, const char *addr, int port)
Definition: yateclass.h:7719
NamedIterator & operator=(const NamedIterator &original)
Definition: yateclass.h:4963
void set(u_int32_t seed)
Definition: yateclass.h:3820
GenObject * remove(bool delobj=true)
void * userObject(const String &name) const
Definition: yateclass.h:3276
const char * familyName()
Definition: yateclass.h:6062
const String & nextName() const
Definition: yateclass.h:7828
void debugName(const char *name)
Definition: yateclass.h:391
Hasher()
Definition: yateclass.h:4268
RefPointer< Obj > & operator=(Obj *object)
Definition: yateclass.h:1136
GenObject * at(int index) const
Definition: yateclass.h:1532
NamedList & setParam(NamedString *param)
Definition: yateclass.h:4707
Ephemeral object counter changer.
Definition: yateclass.h:5875
static bool stripBOM(const char *&str)
Definition: yateclass.h:2093
bool acquire(Lockable &lck, long maxwait=-1)
Definition: yateclass.h:5487
virtual bool getParams(const String ¶ms, NamedList &result)
Definition: yateclass.h:7075
static ObjList & eventsRw()
Definition: yateclass.h:3166
Type
Definition: yateclass.h:7852
Encapsulates a runnable task.
Definition: yateclass.h:5583
virtual bool valid() const
Definition: yateclass.h:6598
CapturedEvent(int level, const char *text)
Definition: yateclass.h:3119
int writeComp(const String &data, bool flush)
Definition: yateclass.h:8190
Base64 & operator<<(const DataBlock &data)
Definition: yateclass.h:4612
Abstract SCTP Socket.
Definition: yateclass.h:7443
struct sockaddr * address() const
Definition: yateclass.h:6122
A standard SHA1 digest calculator.
Definition: yateclass.h:4375
GenPointer(Obj *object)
Definition: yateclass.h:1190
Time(const struct timeval *tv)
Definition: yateclass.h:3633
Encapsulation for an URI.
Definition: yateclass.h:4995
int family() const
Definition: yateclass.h:6055
unsigned int count() const
Definition: yateclass.h:4677
void overAlloc(unsigned int bytes)
Definition: yateclass.h:3948
Time & operator-=(int64_t delta)
Definition: yateclass.h:3694
Hasher & operator<<(const String &value)
Definition: yateclass.h:4174
String & operator=(const String &value)
Definition: yateclass.h:2300
String & operator=(bool value)
Definition: yateclass.h:2352
static bool checkBOM(const char *str)
Definition: yateclass.h:2078
URI & operator=(const URI &value)
Definition: yateclass.h:5040
int operator[](signed int index) const
Definition: yateclass.h:4021
A class exposing system resources usage.
Definition: yateclass.h:8248
static void capturing(bool capture)
Definition: yateclass.h:3173
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:4029
CapturedEvent(const CapturedEvent &original)
Definition: yateclass.h:3127
bool eof() const
Definition: yateclass.h:4975
GenObject * operator[](signed int index) const
Definition: yateclass.h:1322
virtual void * getObject(const String &name) const
Definition: yateclass.h:7579
Base64 & operator<<(const String &value)
Definition: yateclass.h:4606
void destruct(GenObject *obj)
Definition: yateclass.h:934
bool initVector(const DataBlock &vect, Direction dir=Bidir)
Definition: yateclass.h:8048
static unsigned int rawLength()
Definition: yateclass.h:4353
const String & host() const
Definition: yateclass.h:6084
bool scopeId(unsigned int val)
Definition: yateclass.h:6077
URI & operator=(const String &value)
Definition: yateclass.h:5047
char operator[](signed int index) const
Definition: yateclass.h:2252
void assign(RefObject *oldptr, RefObject *newptr, void *pointer)
int64_t seek(int64_t offset)
Definition: yateclass.h:6510
ObjList * paramList()
Definition: yateclass.h:4913
UChar(unsigned char code)
Definition: yateclass.h:1775
UChar & operator=(uint32_t code)
Definition: yateclass.h:1784
static String & appendTo(String &buf, const String &addr, int port, int family=Unknown)
Definition: yateclass.h:6237
Obj & operator*() const
Definition: yateclass.h:1155
TxtRecord(int ttl, const char *text)
Definition: yateclass.h:7670
RefPointer(Obj *object)
Definition: yateclass.h:1118
DSCP
Definition: yateclass.h:6902
GenObject * userData() const
Definition: yateclass.h:3254
A single Unicode character.
Definition: yateclass.h:1739
void append(void *value, unsigned int len)
Definition: yateclass.h:3971
bool unHexify(const String &data)
Definition: yateclass.h:4089
static String appendTo(const String &addr, int port, int family=Unknown)
Definition: yateclass.h:6250
A time holding class.
Definition: yateclass.h:3611
Time & operator+=(int64_t delta)
Definition: yateclass.h:3688
static bool isLeap(unsigned int year)
Definition: yateclass.h:3781
SocketAddr(const SocketAddr &value)
Definition: yateclass.h:5958
const String & text() const
Definition: yateclass.h:7678
const String * operator->() const
Definition: yateclass.h:3098
virtual bool lock(long maxwait=-1)=0
Obj & operator*() const
Definition: yateclass.h:1222
Direction
Definition: yateclass.h:7948
A holder for a debug level.
Definition: yateclass.h:309
Lock2(Mutex *mx1, Mutex *mx2, long maxwait=-1)
Definition: yateclass.h:5516
RefObject holding a Socket pointer.
Definition: yateclass.h:7555
A generic socket class.
Definition: yateclass.h:6884
DataBlock m_data
Definition: yateclass.h:6636
virtual unsigned int hashLength() const
Definition: yateclass.h:4360
int error() const
Definition: yateclass.h:6418
void * data() const
Definition: yateclass.h:3902
bool acquire(Lockable *lck, long maxwait=-1)
Definition: yateclass.h:5477
An abstract hashing class.
Definition: yateclass.h:4111
DebugLevel
Definition: yateclass.h:254
TempObjectCounter(NamedCounter *counter, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:5884
static const NamedList & empty()
void reset()
Definition: yateclass.h:3595
String msgUnescape(int *errptr=0, char extraEsc=0) const
Definition: yateclass.h:2790
int lenUtf8(uint32_t maxChar=0x10ffff, bool overlong=false) const
Definition: yateclass.h:2060
String & operator<<(char value)
Definition: yateclass.h:2453
An object that logs messages on creation and destruction.
Definition: yateclass.h:570
int getPort() const
Definition: yateclass.h:5089
void reset()
Definition: yateclass.h:4981
Atom string holder.
Definition: yateclass.h:3076
String & operator<<(int32_t value)
Definition: yateclass.h:2459
void debugChain(const DebugEnabler *chain=0)
Definition: yateclass.h:377
A named pointer class.
Definition: yateclass.h:3234
bool enabled() const
Definition: yateclass.h:3321
class * YOBJECT(class type, GenObject *pntr)
socklen_t length() const
Definition: yateclass.h:6129
constant YATOM(const char *string)
String & operator<<(bool value)
Definition: yateclass.h:2483
bool setKey(const DataBlock &key, Direction dir=Bidir)
Definition: yateclass.h:8030
void DDebug(int level, const char *format,...)
const String & getDescription() const
Definition: yateclass.h:5061
Obj * operator->() const
Definition: yateclass.h:1216
int64_t m_offset
Definition: yateclass.h:6641
A named string class.
Definition: yateclass.h:3186
virtual void finalize(bool comp)
Definition: yateclass.h:8136
A standard SHA256 digest calculator.
Definition: yateclass.h:4472
bool setTOS(const char *tos, int defTos=Normal)
Definition: yateclass.h:7091
String msgEscape(char extraEsc=0) const
Definition: yateclass.h:2772
bool operator!=(const String &value) const
Definition: yateclass.h:2431
static unsigned int rawLength()
Definition: yateclass.h:4537
void drop()
Definition: yateclass.h:5468
bool operator==(const String &value) const
Definition: yateclass.h:2425
DNS services.
Definition: yateclass.h:7846
int getColumns() const
Definition: yateclass.h:1710
const char * c_str(const String *str)
Definition: yateclass.h:2880
DebugEnabler(int level=TelEngine::debugLevel(), bool enabled=true)
Definition: yateclass.h:317
bool null(const char *str)
Definition: yateclass.h:2904
void NDebug(int level, const char *format,...)
int pref() const
Definition: yateclass.h:7631
static void * getObject(const String &name, const GenObject *obj)
Definition: yateclass.h:879
const String & getHost() const
Definition: yateclass.h:5082
NamedCounter * getObjCounter() const
Definition: yateclass.h:900
Base64 encoder/decoder class.
Definition: yateclass.h:4559
void YCLASSIMP3(class type, class base1, class base2, class base3)
A hashed object list class.
Definition: yateclass.h:3363
SctpSocket()
Definition: yateclass.h:7450
void clear(bool deleteData=true)
bool stripBOM()
Definition: yateclass.h:2108
const String & addr() const
Definition: yateclass.h:6091
int refcount() const
Definition: yateclass.h:1000
void YCLASSIMP(class type, class base)
Base64 & operator<<(const char *value)
Definition: yateclass.h:4618
A named string container class.
Definition: yateclass.h:4628
String operator+(const String &s1, const String &s2)
void * m_pointer
Definition: yateclass.h:1076
DataBlock & operator+=(const String &value)
Definition: yateclass.h:4046
const String & getProtocol() const
Definition: yateclass.h:5068
char operator[](unsigned int index) const
Definition: yateclass.h:2260
virtual bool matches(const String &value) const
Definition: yateclass.h:3030
Templated smart pointer class.
Definition: yateclass.h:1082
Ephemeral mutex or semaphore locking object.
Definition: yateclass.h:5432
Lock2(Mutex &mx1, Mutex &mx2, long maxwait=-1)
Definition: yateclass.h:5526
virtual Socket * accept(SocketAddr &addr)
Definition: yateclass.h:7496
bool hmacStart(DataBlock &opad, const String &key)
Definition: yateclass.h:4214
void YCLASS3(class type, class base1, class base2, class base3)
Pseudo random number generator.
Definition: yateclass.h:3798
String & operator<<(String &str, const Complex &c)
Definition: yatemath.h:1685
GenPointer(const GenPointer< Obj > &value)
Definition: yateclass.h:1182
bool update(const void *buf, unsigned int len)
Definition: yateclass.h:4151
Hasher & operator<<(const DataBlock &data)
Definition: yateclass.h:4181
Semaphore implementation.
Definition: yateclass.h:5354
An abstract stream class capable of reading and writing.
Definition: yateclass.h:6397
void YCLASSIMP2(class type, class base1, class base2)
void clearError()
Definition: yateclass.h:6552
Base64()
Definition: yateclass.h:4566
String & append(const ObjList &list, const char *separator=0, bool force=false)
Definition: yateclass.h:2553
TempObjectCounter(const GenObject *obj, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:5893
A Stream that operates on DataBlocks in memory.
Definition: yateclass.h:6562
Templated pointer that can be inserted in a list.
Definition: yateclass.h:1162
bool encrypt(DataBlock &data)
Definition: yateclass.h:8065
virtual bool matches(const String &value) const
Definition: yateclass.h:2706
static bool errorString(String &buffer)
Definition: yateclass.h:5830
virtual void * getObject(const String &name) const
Time(const struct timeval &tv)
Definition: yateclass.h:3641
Ephemeral double mutex locking object.
Definition: yateclass.h:5506
bool valid() const
Definition: yateclass.h:6041
unsigned int length() const
Definition: yateclass.h:1512
int writeDecomp(const DataBlock &data, bool flush)
Definition: yateclass.h:8218
int level() const
Definition: yateclass.h:3135
SctpSocket(SOCKET fd)
Definition: yateclass.h:7457
ObjList * getHashList(const String &str) const
Definition: yateclass.h:3420
bool isCurrent() const
Definition: yateclass.h:5760
static NamedCounter * setCurrentObjCounter(NamedCounter *counter)
HANDLE handle() const
Definition: yateclass.h:6706
static const ObjList & events()
Definition: yateclass.h:3150
A text based DNS record.
Definition: yateclass.h:7660
Definition: yateclass.h:217
int writeData(const String &str)
Definition: yateclass.h:6472
int ttl() const
Definition: yateclass.h:7617
const DataBlock & data() const
Definition: yateclass.h:6585
TOS
Definition: yateclass.h:6891
NamedPointer & operator=(const char *value)
Definition: yateclass.h:3282
NamedString & operator=(const char *value)
Definition: yateclass.h:3220
const ObjList * paramList() const
Definition: yateclass.h:4920
bool operator!=(const SocketAddr &other) const
Definition: yateclass.h:6001
A C-style string handling class.
Definition: yateclass.h:1907
Atom(const char *value)
Definition: yateclass.h:3083
void assign(Obj *object=0)
Definition: yateclass.h:1096
bool locked() const
Definition: yateclass.h:5540
const char * strcpy(String &dest, const char *src)
Definition: yateclass.h:2934
Class used to iterate the items of a list.
Definition: yateclass.h:3512
Definition: yateclass.h:683
static const TokenDict * directions()
Definition: yateclass.h:7958
Priority
Definition: yateclass.h:5614
const char * c_str() const
Definition: yateclass.h:1806
bool setIpv6OnlyOption(bool on)
Definition: yateclass.h:7043
Time(u_int64_t usec)
Definition: yateclass.h:3625
bool autoDelete()
Definition: yateclass.h:1598
TempObjectCounter(const GenObject &obj, bool enable=GenObject::getObjCounting())
Definition: yateclass.h:5902
const char * debugLevelName(int level)
DnsRecord(int ttl, int order, int pref)
Definition: yateclass.h:7602
virtual bool setParams(const NamedList ¶ms)
Definition: yateclass.h:7066
u_int64_t usec() const
Definition: yateclass.h:3670
const char * safe() const
Definition: yateclass.h:2020
int writeComp(const DataBlock &data, bool flush)
Definition: yateclass.h:8179
static bool scopeId(struct sockaddr *addr, unsigned int val)
Definition: yateclass.h:6210
void Output(const char *format,...)
const String & serv() const
Definition: yateclass.h:7807
An object list class.
Definition: yateclass.h:1230
unsigned int length() const
Definition: yateclass.h:3934
unsigned int length() const
Definition: yateclass.h:2035
void Alarm(const char *component, int level, const char *format,...)
Lock(Lockable *lck, long maxwait=-1)
Definition: yateclass.h:5449
bool null() const
Definition: yateclass.h:3927
void clearParams()
Definition: yateclass.h:4683
const String & repTemplate() const
Definition: yateclass.h:7821
void YCLASS(class type, class base)
NamedIterator(const NamedIterator &original)
Definition: yateclass.h:4948
unsigned int scopeId() const
Definition: yateclass.h:6069
void setDelete(bool autodelete)
Definition: yateclass.h:1436
~TempObjectCounter()
Definition: yateclass.h:5909
static bool stripBOM(char *&str)
Definition: yateclass.h:2101
bool debugEnabled() const
Definition: yateclass.h:342
int at(unsigned int offs, int defvalue=-1) const
Definition: yateclass.h:3920
bool update(const DataBlock &data)
Definition: yateclass.h:4159
Type
Definition: yateclass.h:8254
ObjList * getHashList(unsigned int hash) const
Definition: yateclass.h:3412
DnsRecord()
Definition: yateclass.h:7609
NamedList parameters iterator.
Definition: yateclass.h:4933
A vector holding GenObjects.
Definition: yateclass.h:1468
virtual bool terminate()
Definition: yateclass.h:6592
A SRV record.
Definition: yateclass.h:7706
Random(u_int32_t seed=Time::now()&0xffffffff)
Definition: yateclass.h:3805
Obj * operator->() const
Definition: yateclass.h:1149
Lockable * locked() const
Definition: yateclass.h:5462
Mutex * mutex(unsigned int idx) const
Definition: yateclass.h:5341
void YIGNORE(primitive value)
bool matches(const char *value) const
UChar(signed char code)
Definition: yateclass.h:1767
Family
Definition: yateclass.h:5930
Mutex support.
Definition: yateclass.h:5206
unsigned int hash() const
Definition: yateclass.h:2115
A standard MD5 digest calculator.
Definition: yateclass.h:4288
RefPointerBase()
Definition: yateclass.h:1062
An abstract data (de)compressor.
Definition: yateclass.h:8094
String & operator=(const String *value)
Definition: yateclass.h:2308
Engine globals.
Definition: yatengine.h:1161
Definition: yateclass.h:831
SocketAddr()
Definition: yateclass.h:5950
void debugEnabled(bool enable)
Definition: yateclass.h:349
unsigned int overAlloc() const
Definition: yateclass.h:3941
String & operator<<(uint32_t value)
Definition: yateclass.h:2465
int getRows() const
Definition: yateclass.h:1703
bool controlReturn(NamedList *params, bool ret, const char *retVal=0)
static Direction direction(const char *name, Direction defdir=Bidir)
Definition: yateclass.h:7967
String & operator+=(const char *value)
Definition: yateclass.h:2366
Atomic counter with name.
Definition: yateclass.h:3307
void YCLASS2(class type, class base1, class base2)