From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/a05042.html | 99 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 docs/doxygen/nel/a05042.html (limited to 'docs/doxygen/nel/a05042.html') diff --git a/docs/doxygen/nel/a05042.html b/docs/doxygen/nel/a05042.html new file mode 100644 index 00000000..ee2ea53a --- /dev/null +++ b/docs/doxygen/nel/a05042.html @@ -0,0 +1,99 @@ + + +NeL: string_common.h File Reference + + + +
+

string_common.h File Reference


Detailed Description

+common algorithms on string like toString() and fromString()

+

Id
string_common.h,v 1.4 2004/01/07 18:31:13 lecroart Exp
+ +

+Definition in file string_common.h. +

+#include "nel/misc/types_nl.h"
+#include <cstdio>
+#include <cstdarg>
+ +

+Go to the source code of this file. + + + + + + + +

Namespaces

namespace  NLMISC

Defines

#define NLMISC_CONVERT_VARGS(_dest, _format, _size)
+


Define Documentation

+

+ + + + +
+ + + + + + + + + + + + + +
#define NLMISC_CONVERT_VARGS_dest,
_format,
_size   )  +
+
+ + + + + +
+   + + +

+Value:

char _cstring[_size]; \
+va_list _args; \
+va_start (_args, _format); \
+int _res = vsnprintf (_cstring, _size-1, _format, _args); \
+if (_res == -1 || _res == _size-1) \
+{ \
+        _cstring[_size-1] = '\0'; \
+} \
+va_end (_args); \
+_dest = _cstring
+
This macro converts variable arguments into C string (zero terminated string). This function takes care to avoid buffer overflow.

+Example:

void MyFunction(const char *format, ...) + { + string str; + NLMISC_CONVERT_VARGS (str, format, NLMISC::MaxCStringSize); + // str contains the result of the conversion + } + * +

+

Parameters:
+ + + + +
_dest string or char* that contains the result of the convertion
_format format of the string, it must be the last argument before the '...'
_size size of the buffer that will contain the C string
+
+ +

+Definition at line 70 of file string_common.h. +

+Referenced by NLMISC::CLog::display(), NLMISC::CLog::displayNL(), NLMISC::CLog::displayRaw(), NLMISC::CLog::displayRawNL(), NLMISC::Exception::Exception(), NLMISC::CLog::forceDisplayRaw(), NLMISC::nlError(), NLMISC::nlFatalError(), NL3D::CTextContextUser::printfAt(), NL3D::CTextContext::printfAt(), NL3D::CTextContextUser::render3D(), NLNET::sendAdminEmail(), NL3D::CTextContextUser::textPush(), NL3D::CTextContext::textPush(), NLMISC::toString(), NLMISC::xmlGenericErrorFuncRead(), and NLMISC::xmlGenericErrorFuncWrite().

+


Generated on Tue Mar 16 06:43:22 2004 for NeL by + +doxygen +1.3.6
+ + -- cgit v1.2.1