Compare commits

...

10 Commits

@ -157,6 +157,10 @@ IF(FINAL_VERSION)
ADD_DEFINITIONS(-DFINAL_VERSION=1) ADD_DEFINITIONS(-DFINAL_VERSION=1)
ENDIF() ENDIF()
IF(WIN32 AND NOT WITH_STATIC2)
ADD_DEFINITIONS(-DNL_DLLEXP)
ENDIF()
IF(WITH_SSE2) IF(WITH_SSE2)
ADD_DEFINITIONS(-DNL_HAS_SSE2) ADD_DEFINITIONS(-DNL_HAS_SSE2)
IF(WITH_SSE3) IF(WITH_SSE3)

@ -30,6 +30,13 @@ MACRO(NL_TARGET_LIB name)
ADD_LIBRARY(${name} SHARED ${ARGN}) ADD_LIBRARY(${name} SHARED ${ARGN})
ENDIF() ENDIF()
ENDMACRO(NL_TARGET_LIB) ENDMACRO(NL_TARGET_LIB)
MACRO(NL_TARGET_LIB2 name)
IF(WITH_STATIC2)
ADD_LIBRARY(${name} STATIC ${ARGN})
ELSE()
ADD_LIBRARY(${name} SHARED ${ARGN})
ENDIF()
ENDMACRO(NL_TARGET_LIB2)
### ###
# #
@ -216,6 +223,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
ELSE() ELSE()
OPTION(WITH_STATIC "With static libraries." OFF) OPTION(WITH_STATIC "With static libraries." OFF)
ENDIF() ENDIF()
OPTION(WITH_STATIC2 "With static libraries (porting support)." OFF)
IF (WITH_STATIC) IF (WITH_STATIC)
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON ) OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON )
ELSE() ELSE()

@ -22,7 +22,7 @@
#include "form_elm.h" #include "form_elm.h"
#include "header.h" #include "header.h"
extern bool convertFormFile (const std::string &oldFileName, const std::string &newFileName); NLGEORGES_API extern bool convertFormFile(const std::string &oldFileName, const std::string &newFileName);
namespace NLGEORGES namespace NLGEORGES
{ {

@ -38,7 +38,7 @@ class UForm : public NLMISC::CRefCount
{ {
public: public:
virtual ~UForm (); virtual ~UForm() {}
/** /**
* Access form nodes * Access form nodes

@ -58,10 +58,10 @@ public:
virtual UType *loadFormType (const std::string &filename) = 0; virtual UType *loadFormType (const std::string &filename) = 0;
/// Create a form loader /// Create a form loader
static UFormLoader *createLoader (); NLGEORGES_API static UFormLoader *createLoader();
/// Create a form loader /// Create a form loader
static void releaseLoader (UFormLoader *loader); NLGEORGES_API static void releaseLoader(UFormLoader *loader);
}; };

@ -36,7 +36,7 @@ class CPrimitive;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CLigoConfig class NLLIGO_API CLigoConfig
{ {
public: public:

@ -31,7 +31,7 @@ namespace NLLIGO
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CLigoError class NLLIGO_API CLigoError
{ {
public: public:
enum TError enum TError

@ -36,7 +36,7 @@ class CLigoConfig;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CMaterial class NLLIGO_API CMaterial
{ {
public: public:

@ -79,7 +79,7 @@ public:
* This class is a property class for ligo primitive. * This class is a property class for ligo primitive.
* This is a simple string * This is a simple string
*/ */
class CPropertyString : public IProperty class NLLIGO_API CPropertyString : public IProperty
{ {
public: public:
CPropertyString () {} CPropertyString () {}
@ -106,7 +106,7 @@ public:
* This class is a property class for ligo primitive. * This class is a property class for ligo primitive.
* This is a string array * This is a string array
*/ */
class CPropertyStringArray : public IProperty class NLLIGO_API CPropertyStringArray : public IProperty
{ {
public: public:
CPropertyStringArray () {} CPropertyStringArray () {}
@ -132,7 +132,7 @@ public:
* This class is a property class for ligo primitive. * This class is a property class for ligo primitive.
* This is a string array * This is a string array
*/ */
class CPropertyColor : public IProperty class NLLIGO_API CPropertyColor : public IProperty
{ {
public: public:
NLMISC::CRGBA Color; NLMISC::CRGBA Color;
@ -154,7 +154,7 @@ public:
// *************************************************************************** // ***************************************************************************
class CPrimVector : public NLMISC::CVector class NLLIGO_API CPrimVector : public NLMISC::CVector
{ {
public: public:
CPrimVector () CPrimVector ()
@ -184,7 +184,7 @@ public:
* Provide access to common properties. * Provide access to common properties.
* Provide access to the primitive hierachy * Provide access to the primitive hierachy
*/ */
class IPrimitive : public NLMISC::IStreamable class NLLIGO_API IPrimitive : public NLMISC::IStreamable
{ {
friend class CPrimitives; friend class CPrimitives;
public: public:
@ -417,7 +417,7 @@ private:
// *************************************************************************** // ***************************************************************************
// Simple primitive node // Simple primitive node
class CPrimNode : public IPrimitive class NLLIGO_API CPrimNode : public IPrimitive
{ {
public: public:
// \name From IClassable // \name From IClassable
@ -442,7 +442,7 @@ protected:
// *************************************************************************** // ***************************************************************************
class CPrimPoint : public IPrimitive class NLLIGO_API CPrimPoint : public IPrimitive
{ {
public: public:
@ -484,7 +484,7 @@ protected:
// *************************************************************************** // ***************************************************************************
class CPrimPath : public IPrimitive class NLLIGO_API CPrimPath : public IPrimitive
{ {
public: public:
@ -520,7 +520,7 @@ protected:
// *************************************************************************** // ***************************************************************************
class CPrimZone : public IPrimitive class NLLIGO_API CPrimZone : public IPrimitive
{ {
public: public:
@ -583,7 +583,7 @@ protected:
* Usage of this primitive imply the setting of the appropriate 'ligo context' * Usage of this primitive imply the setting of the appropriate 'ligo context'
* before reading or copy/pasting alias. * before reading or copy/pasting alias.
*/ */
class CPrimAlias : public IPrimitive class NLLIGO_API CPrimAlias : public IPrimitive
{ {
friend class CPrimitives; friend class CPrimitives;
@ -646,7 +646,7 @@ public:
/* /*
This class is deprecated. This class is deprecated.
*/ */
class CPrimRegion class NLLIGO_API CPrimRegion
{ {
public: public:
@ -670,7 +670,7 @@ public:
/** /**
* This class is a ligo primitives set * This class is a ligo primitives set
*/ */
class CPrimitives class NLLIGO_API CPrimitives
{ {
public: public:
@ -752,7 +752,7 @@ private:
/** Singleton to manage special loading feature related to /** Singleton to manage special loading feature related to
* unique alias assignment * unique alias assignment
*/ */
class CPrimitiveContext class NLLIGO_API CPrimitiveContext
{ {
static CPrimitiveContext *_Instance; static CPrimitiveContext *_Instance;

@ -39,7 +39,7 @@ class CLigoConfig;
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CPrimitiveClass class NLLIGO_API CPrimitiveClass
{ {
public: public:
@ -127,7 +127,7 @@ public:
}; };
// Parameter description // Parameter description
class CParameter : public CInitParameters class NLLIGO_API CParameter : public CInitParameters
{ {
public: public:
CParameter () {} CParameter () {}

@ -38,7 +38,7 @@ class IPrimitive;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CPrimitiveConfigurations class NLLIGO_API CPrimitiveConfigurations
{ {
public: public:

@ -361,10 +361,10 @@ void filterPrimitiveChilds(IPrimitive *parent, Pred &predicate, TPrimitiveSet &r
* return a unique node because there is no name * return a unique node because there is no name
* uniqueness constraint in the primitive system. * uniqueness constraint in the primitive system.
*/ */
std::string buildPrimPath(const IPrimitive *prim); NLLIGO_API std::string buildPrimPath(const IPrimitive *prim);
/** Return a set of primitive that match a given path*/ /** Return a set of primitive that match a given path*/
void selectPrimByPath(IPrimitive *rootNode, const std::string &path, TPrimitiveSet &result); NLLIGO_API void selectPrimByPath(IPrimitive *rootNode, const std::string &path, TPrimitiveSet &result);
} // namespace NLLIGO } // namespace NLLIGO

@ -38,7 +38,7 @@ class CMaterial;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CTransition class NLLIGO_API CTransition
{ {
public: public:

@ -45,7 +45,7 @@ namespace NLLIGO
// *************************************************************************** // ***************************************************************************
class CZoneBankElement class NLLIGO_API CZoneBankElement
{ {
// Category stuff // Category stuff
@ -87,7 +87,7 @@ public:
// *************************************************************************** // ***************************************************************************
class CZoneBank class NLLIGO_API CZoneBank
{ {
std::map<std::string,CZoneBankElement> _ElementsMap; std::map<std::string,CZoneBankElement> _ElementsMap;

@ -43,7 +43,7 @@ class CLigoConfig;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CZoneEdge class NLLIGO_API CZoneEdge
{ {
public: public:

@ -33,7 +33,7 @@ namespace NLLIGO
// *************************************************************************** // ***************************************************************************
struct SPiece struct NLLIGO_API SPiece
{ {
sint32 w, h; // Max 255x255 sint32 w, h; // Max 255x255
std::vector<uint8> Tab; std::vector<uint8> Tab;
@ -43,7 +43,7 @@ struct SPiece
// *************************************************************************** // ***************************************************************************
class CZoneRegion class NLLIGO_API CZoneRegion
{ {
public: public:

@ -37,7 +37,7 @@ class CLigoError;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CZoneTemplate class NLLIGO_API CZoneTemplate
{ {
public: public:

@ -38,7 +38,7 @@ class CMatrix;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CAABBox class NLMISC_API CAABBox
{ {
protected: protected:
/// The center of the bbox. /// The center of the bbox.
@ -151,7 +151,7 @@ public:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CAABBoxExt : private CAABBox class NLMISC_API CAABBoxExt : private CAABBox
{ {
protected: protected:
float RadiusMin, RadiusMax; float RadiusMin, RadiusMax;

@ -82,12 +82,12 @@ T computeBilinear(const T &v0, const T &v1, const T &v2, const T &v3, const U &s
/** Select all points crossed by the line [(x0,y0) ; (x1,y1)] /** Select all points crossed by the line [(x0,y0) ; (x1,y1)]
* Not the same than brensenham * Not the same than brensenham
*/ */
void drawFullLine (float x0, float y0, float x1, float y1, std::vector<std::pair<sint, sint> > &result); NLMISC_API void drawFullLine(float x0, float y0, float x1, float y1, std::vector<std::pair<sint, sint>> &result);
// *************************************************************************** // ***************************************************************************
/** Select points on the line [(x0,y0) ; (x1,y1)] /** Select points on the line [(x0,y0) ; (x1,y1)]
*/ */
void drawLine (float x0, float y0, float x1, float y1, std::vector<std::pair<sint, sint> > &result); NLMISC_API void drawLine(float x0, float y0, float x1, float y1, std::vector<std::pair<sint, sint>> &result);
// *************************************************************************** // ***************************************************************************
@ -177,18 +177,18 @@ static inline void fastClamp8(sint &v)
* return false if wildcard has some "**" or "*?" * return false if wildcard has some "**" or "*?"
* NB: case-sensitive * NB: case-sensitive
*/ */
bool testWildCard(const char *strIn, const char *wildCard); NLMISC_API bool testWildCard(const char *strIn, const char *wildCard);
bool testWildCard(const std::string &strIn, const std::string &wildCard); NLMISC_API bool testWildCard(const std::string &strIn, const std::string &wildCard);
// *************************************************************************** // ***************************************************************************
/** From a string with some separators, build a vector of string. /** From a string with some separators, build a vector of string.
* eg: splitString("hello|bye|||bee", "|", list) return 3 string into list: "hello", "bye" and "bee". * eg: splitString("hello|bye|||bee", "|", list) return 3 string into list: "hello", "bye" and "bee".
*/ */
void splitString(const std::string &str, const std::string &separator, std::vector<std::string> &retList); NLMISC_API void splitString(const std::string &str, const std::string &separator, std::vector<std::string> &retList);
void splitUCString(const ucstring &ucstr, const ucstring &separator, std::vector<ucstring> &retList); NLMISC_API void splitUCString(const ucstring &ucstr, const ucstring &separator, std::vector<ucstring> &retList);
// *************************************************************************** // ***************************************************************************
/// In a string or ucstring, find a substr and replace it with another. return true if replaced /// In a string or ucstring, find a substr and replace it with another. return true if replaced

@ -41,7 +41,7 @@ namespace NLMISC
* \author Boris 'SoniX' Boucher * \author Boris 'SoniX' Boucher
* \date 2005 * \date 2005
*/ */
class INelContext class NLMISC_API INelContext
{ {
static INelContext ** _getInstance(); static INelContext ** _getInstance();
public: public:
@ -104,7 +104,7 @@ namespace NLMISC
* \author Boris 'SoniX' Boucher * \author Boris 'SoniX' Boucher
* \date 2005 * \date 2005
*/ */
class CApplicationContext : public INelContext class NLMISC_API CApplicationContext : public INelContext
{ {
public: public:
CApplicationContext(); CApplicationContext();
@ -160,7 +160,7 @@ namespace NLMISC
* \author Boris 'SoniX' Boucher * \author Boris 'SoniX' Boucher
* \date 2005 * \date 2005
*/ */
class CLibraryContext : public INelContext class NLMISC_API CLibraryContext : public INelContext
{ {
public: public:
CLibraryContext (INelContext &applicationContext); CLibraryContext (INelContext &applicationContext);

@ -31,7 +31,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CAsyncFileManager : public CTaskManager class NLMISC_API CAsyncFileManager : public CTaskManager
{ {
NLMISC_SAFE_SINGLETON_DECL(CAsyncFileManager); NLMISC_SAFE_SINGLETON_DECL(CAsyncFileManager);
CAsyncFileManager() {} CAsyncFileManager() {}

@ -35,7 +35,7 @@ const uint32 BF_ALWAYS_OPENED = 0x00000001;
const uint32 BF_CACHE_FILE_ON_OPEN = 0x00000002; const uint32 BF_CACHE_FILE_ON_OPEN = 0x00000002;
// *************************************************************************** // ***************************************************************************
class CBigFile class NLMISC_API CBigFile
{ {
NLMISC_SAFE_SINGLETON_DECL(CBigFile); NLMISC_SAFE_SINGLETON_DECL(CBigFile);

@ -365,7 +365,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2001, 2003 * \date 2001, 2003
*/ */
class CBitMemStream : public CMemStream class NLMISC_API CBitMemStream : public CMemStream
{ {
public: public:

@ -37,7 +37,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CBitSet class NLMISC_API CBitSet
{ {
public: public:
/* *********************************************** /* ***********************************************

@ -70,7 +70,7 @@ const uint8 MAX_MIPMAP = 16;
* *** IF YOU MODIFY THE STRUCTURE OF THIS CLASS, PLEASE INCREMENT IDriver::InterfaceVersion TO INVALIDATE OLD DRIVER DLL * *** IF YOU MODIFY THE STRUCTURE OF THIS CLASS, PLEASE INCREMENT IDriver::InterfaceVersion TO INVALIDATE OLD DRIVER DLL
* ********************************** * **********************************
*/ */
class CBitmap class NLMISC_API CBitmap
{ {
protected : protected :
CObjectVector<uint8> _Data[MAX_MIPMAP]; CObjectVector<uint8> _Data[MAX_MIPMAP];

@ -30,7 +30,7 @@ namespace NLMISC
// *************************************************************************** // ***************************************************************************
/// See CBlockMemory::Purge /// See CBlockMemory::Purge
extern bool NL3D_BlockMemoryAssertOnPurge; // =true. NLMISC_API extern bool NL3D_BlockMemoryAssertOnPurge; // =true.
// *************************************************************************** // ***************************************************************************

@ -33,7 +33,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CBSphere class NLMISC_API CBSphere
{ {
public: public:
CVector Center; CVector Center;

@ -60,7 +60,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CBufFIFO class NLMISC_API CBufFIFO
{ {
public: public:

@ -44,7 +44,7 @@ class CCDBBankHandler;
* \date 2002 * \date 2002
*/ */
class ICDBNode : public CRefCount class NLMISC_API ICDBNode : public CRefCount
{ {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// end of IDBNode interface // end of IDBNode interface

@ -32,7 +32,8 @@ namespace NLMISC{
and the other way around. and the other way around.
*/ */
class CCDBBankHandler{ class NLMISC_API CCDBBankHandler
{
public: public:
/** /**
@brief The class' constructor @brief The class' constructor

@ -31,7 +31,7 @@ namespace NLMISC{
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CCDBNodeBranch : public ICDBNode class NLMISC_API CCDBNodeBranch : public ICDBNode
{ {
public: public:

@ -28,7 +28,8 @@ namespace NLMISC{
The marked observers can then be notified and flushed on request. The marked observers can then be notified and flushed on request.
*/ */
class CCDBBranchObservingHandler{ class NLMISC_API CCDBBranchObservingHandler
{
enum{ enum{
MAX_OBS_LST = 2 MAX_OBS_LST = 2

@ -32,7 +32,7 @@ namespace NLMISC{
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CCDBCheckSum class NLMISC_API CCDBCheckSum
{ {
public: public:
///constructor ///constructor

@ -32,7 +32,7 @@ namespace NLMISC{
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CCDBNodeLeaf : public ICDBNode class NLMISC_API CCDBNodeLeaf : public ICDBNode
{ {
public: public:
// flush all observers calls for modified nodes // flush all observers calls for modified nodes

@ -26,7 +26,8 @@
namespace NLMISC{ namespace NLMISC{
/// Class that encapsulates the separate CDB components /// Class that encapsulates the separate CDB components
class CCDBManager{ class NLMISC_API CCDBManager
{
public: public:
/** /**

@ -22,7 +22,7 @@
namespace NLMISC namespace NLMISC
{ {
class CFpuChecker class NLMISC_API CFpuChecker
{ {
private: private:
static int _RefFpuCtrl; static int _RefFpuCtrl;

@ -33,8 +33,8 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CClassId class NLMISC_API CClassId
{ {
uint64 Uid; uint64 Uid;
public: public:

@ -76,7 +76,7 @@ public:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CClassRegistry class NLMISC_API CClassRegistry
{ {
public: public:
/// Inits the ClassRegistry (especially RegistredClasses) /// Inits the ClassRegistry (especially RegistredClasses)

@ -28,7 +28,7 @@
namespace NLMISC namespace NLMISC
{ {
class CCmdArgs class NLMISC_API CCmdArgs
{ {
public: public:
CCmdArgs(); CCmdArgs();

@ -114,7 +114,7 @@ namespace NLMISC
* *
* *
*/ */
class CCoTask class NLMISC_API CCoTask
{ {
/// Flag stating if the task is started or not /// Flag stating if the task is started or not
bool _Started; bool _Started;

@ -95,7 +95,7 @@ bool __category##_##__name##Class::execute(const std::string &rawCommandString,
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class ICommand class NLMISC_API ICommand
{ {
public: public:
@ -227,7 +227,7 @@ struct TCommandHandlerClassInfo
* \author Nevrax France * \author Nevrax France
* \date 2005 * \date 2005
*/ */
class ICommandsHandler class NLMISC_API ICommandsHandler
{ {
/// Store the class name after handler registration /// Store the class name after handler registration
const std::string *_ClassName; const std::string *_ClassName;
@ -556,7 +556,7 @@ struct TCommandHandler : public TCommandHandlerInfo
* \author Nevrax France * \author Nevrax France
* \date 2005 * \date 2005
*/ */
class CCommandRegistry class NLMISC_API CCommandRegistry
{ {
// this class is a safe singleton (dll friendly) // this class is a safe singleton (dll friendly)
NLMISC_SAFE_SINGLETON_DECL(CCommandRegistry); NLMISC_SAFE_SINGLETON_DECL(CCommandRegistry);

@ -172,18 +172,18 @@ template<class T> inline void contReset (T& a)
* raiseToNextPowerOf2(8) is 8 * raiseToNextPowerOf2(8) is 8
* raiseToNextPowerOf2(5) is 8 * raiseToNextPowerOf2(5) is 8
*/ */
uint raiseToNextPowerOf2 (uint v); NLMISC_API uint raiseToNextPowerOf2(uint v);
/** Return the power of 2 of v. /** Return the power of 2 of v.
* Example: * Example:
* getPowerOf2(8) is 3 * getPowerOf2(8) is 3
* getPowerOf2(5) is 3 * getPowerOf2(5) is 3
*/ */
uint getPowerOf2 (uint v); NLMISC_API uint getPowerOf2(uint v);
/** Return \c true if the value is a power of 2. /** Return \c true if the value is a power of 2.
*/ */
bool isPowerOf2 (sint32 v); NLMISC_API bool isPowerOf2(sint32 v);
/** Converts from degrees to radians /** Converts from degrees to radians
@ -222,37 +222,37 @@ inline double isValidDouble (double v)
* \param str a string to transform to lower case * \param str a string to transform to lower case
*/ */
std::string toLower ( const char *str ); NLMISC_API std::string toLower(const char *str);
std::string toLower ( const std::string &str ); NLMISC_API std::string toLower(const std::string &str);
void toLower ( char *str ); NLMISC_API void toLower(char *str);
char toLower ( const char ch ); // convert only one character NLMISC_API char toLower(const char ch); // convert only one character
/** Convert a string in upper case. /** Convert a string in upper case.
* \param a string to transform to upper case * \param a string to transform to upper case
*/ */
std::string toUpper ( const std::string &str); NLMISC_API std::string toUpper(const std::string &str);
void toUpper ( char *str); NLMISC_API void toUpper(char *str);
/** /**
* Convert to an hexadecimal std::string * Convert to an hexadecimal std::string
*/ */
std::string toHexa(const uint8 &b); NLMISC_API std::string toHexa(const uint8 &b);
std::string toHexa(const uint8 *data, uint size); NLMISC_API std::string toHexa(const uint8 *data, uint size);
std::string toHexa(const std::string &str); NLMISC_API std::string toHexa(const std::string &str);
std::string toHexa(const char *str); NLMISC_API std::string toHexa(const char *str);
/** /**
* Convert from an hexadecimal std::string * Convert from an hexadecimal std::string
*/ */
bool fromHexa(const std::string &hexa, uint8 &b); NLMISC_API bool fromHexa(const std::string &hexa, uint8 &b);
bool fromHexa(const std::string &hexa, uint8 *data); NLMISC_API bool fromHexa(const std::string &hexa, uint8 *data);
bool fromHexa(const std::string &hexa, std::string &str); NLMISC_API bool fromHexa(const std::string &hexa, std::string &str);
bool fromHexa(const char *hexa, uint8 &b); NLMISC_API bool fromHexa(const char *hexa, uint8 &b);
bool fromHexa(const char *hexa, uint8 *data); NLMISC_API bool fromHexa(const char *hexa, uint8 *data);
bool fromHexa(const char *hexa, std::string &str); NLMISC_API bool fromHexa(const char *hexa, std::string &str);
bool fromHexa(const char hexa, uint8 &b); NLMISC_API bool fromHexa(const char hexa, uint8 &b);
// Remove all the characters <= 32 (tab, space, new line, return, vertical tab etc..) at the beginning and at the end of a string // Remove all the characters <= 32 (tab, space, new line, return, vertical tab etc..) at the beginning and at the end of a string
template <class T> T trim (const T &str) template <class T> T trim (const T &str)
@ -325,20 +325,20 @@ inline float nlroundf(float x)
#endif #endif
// Wrapper for fopen to be able to open files with an UTF-8 filename // Wrapper for fopen to be able to open files with an UTF-8 filename
FILE *nlfopen(const std::string &filename, const std::string &mode); NLMISC_API FILE *nlfopen(const std::string &filename, const std::string &mode);
/** Signed 64 bit fseek. Same interface as fseek /** Signed 64 bit fseek. Same interface as fseek
*/ */
int nlfseek64(FILE *stream, sint64 offset, int origin); NLMISC_API int nlfseek64(FILE *stream, sint64 offset, int origin);
// Retrieve position in a file, same interface as ftell // Retrieve position in a file, same interface as ftell
sint64 nlftell64(FILE *stream); NLMISC_API sint64 nlftell64(FILE *stream);
/** /**
* Base class for all NeL exception. * Base class for all NeL exception.
* It enables to construct simple string at the ctor. * It enables to construct simple string at the ctor.
*/ */
class Exception : public std::exception class NLMISC_API Exception : public std::exception
{ {
protected: protected:
std::string _Reason; std::string _Reason;
@ -355,7 +355,7 @@ public:
* Portable Sleep() function that suspends the execution of the calling thread for a number of milliseconds. * Portable Sleep() function that suspends the execution of the calling thread for a number of milliseconds.
* Note: the resolution of the timer is system-dependant and may be more than 1 millisecond. * Note: the resolution of the timer is system-dependant and may be more than 1 millisecond.
*/ */
void nlSleep( uint32 ms ); NLMISC_API void nlSleep(uint32 ms);
/// Returns Process Id (note: on Linux, Process Id is the same as the Thread Id) /// Returns Process Id (note: on Linux, Process Id is the same as the Thread Id)
@ -364,73 +364,73 @@ void nlSleep( uint32 ms );
#endif #endif
/// Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id) /// Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id)
size_t getThreadId(); NLMISC_API size_t getThreadId();
/// Returns a readable string from a vector of bytes. unprintable char are replaced by '?' /// Returns a readable string from a vector of bytes. unprintable char are replaced by '?'
std::string stringFromVector( const std::vector<uint8>& v, bool limited = true ); NLMISC_API std::string stringFromVector(const std::vector<uint8> &v, bool limited = true);
/// Convert a string into an sint64 (same as atoi() function but for 64 bits intergers) /// Convert a string into an sint64 (same as atoi() function but for 64 bits intergers)
sint64 atoiInt64 (const char *ident, sint64 base = 10); NLMISC_API sint64 atoiInt64(const char *ident, sint64 base = 10);
/// Convert an sint64 into a string (same as itoa() function but for 64 bits intergers) /// Convert an sint64 into a string (same as itoa() function but for 64 bits intergers)
void itoaInt64 (sint64 number, char *str, sint64 base = 10); NLMISC_API void itoaInt64(sint64 number, char *str, sint64 base = 10);
/// Convert a number in bytes into a string that is easily readable by an human, for example 105123 -> "102kb" /// Convert a number in bytes into a string that is easily readable by an human, for example 105123 -> "102kb"
std::string bytesToHumanReadable (const std::string &bytes); NLMISC_API std::string bytesToHumanReadable(const std::string &bytes);
std::string bytesToHumanReadable (uint64 bytes); NLMISC_API std::string bytesToHumanReadable(uint64 bytes);
/// Convert a number in bytes into a string that is easily readable by an human, for example 105123 -> "102kb" /// Convert a number in bytes into a string that is easily readable by an human, for example 105123 -> "102kb"
/// Using units array as string: 0 => B, 1 => KiB, 2 => MiB, 3 => GiB, etc... /// Using units array as string: 0 => B, 1 => KiB, 2 => MiB, 3 => GiB, etc...
std::string bytesToHumanReadableUnits (uint64 bytes, const std::vector<std::string> &units); NLMISC_API std::string bytesToHumanReadableUnits(uint64 bytes, const std::vector<std::string> &units);
/// Convert a human readable into a bytes, for example "102kb" -> 105123 /// Convert a human readable into a bytes, for example "102kb" -> 105123
uint32 humanReadableToBytes (const std::string &str); NLMISC_API uint32 humanReadableToBytes(const std::string &str);
/// Convert a time into a string that is easily readable by an human, for example 3600 -> "1h" /// Convert a time into a string that is easily readable by an human, for example 3600 -> "1h"
std::string secondsToHumanReadable (uint32 time); NLMISC_API std::string secondsToHumanReadable(uint32 time);
/// Convert a UNIX timestamp to a formatted date in ISO format /// Convert a UNIX timestamp to a formatted date in ISO format
std::string timestampToHumanReadable(uint32 timestamp); NLMISC_API std::string timestampToHumanReadable(uint32 timestamp);
/// Get a bytes or time in string format and convert it in seconds or bytes /// Get a bytes or time in string format and convert it in seconds or bytes
uint32 fromHumanReadable (const std::string &str); NLMISC_API uint32 fromHumanReadable(const std::string &str);
/// Add digit grouping seperator to if value >= 10 000. Assumes input is numerical string. /// Add digit grouping seperator to if value >= 10 000. Assumes input is numerical string.
std::string formatThousands(const std::string& s); NLMISC_API std::string formatThousands(const std::string &s);
/// This function executes a program in the background and returns instantly (used for example to launch services in AES). /// This function executes a program in the background and returns instantly (used for example to launch services in AES).
/// The program will be launched in the current directory /// The program will be launched in the current directory
bool launchProgram (const std::string &programName, const std::string &arguments, bool log = true); NLMISC_API bool launchProgram(const std::string &programName, const std::string &arguments, bool log = true);
/// Same but with an array of strings for arguments /// Same but with an array of strings for arguments
bool launchProgramArray (const std::string &programName, const std::vector<std::string> &arguments, bool log = true); NLMISC_API bool launchProgramArray(const std::string &programName, const std::vector<std::string> &arguments, bool log = true);
/// This function executes a program and wait for result (used for example for crash report). /// This function executes a program and wait for result (used for example for crash report).
/// The program will be launched in the current directory /// The program will be launched in the current directory
sint launchProgramAndWaitForResult (const std::string &programName, const std::string &arguments, bool log = true); NLMISC_API sint launchProgramAndWaitForResult(const std::string &programName, const std::string &arguments, bool log = true);
/// This function executes a program and returns output as a string /// This function executes a program and returns output as a string
std::string getCommandOutput(const std::string &command); NLMISC_API std::string getCommandOutput(const std::string &command);
/// This function replace all environment variables in a string by their content. /// This function replace all environment variables in a string by their content.
/// Environment variables names can use both Windows (%NAME%) and UNIX syntax ($NAME) /// Environment variables names can use both Windows (%NAME%) and UNIX syntax ($NAME)
/// Authorized characters in names are A-Z, a-z, 0-9 and _ /// Authorized characters in names are A-Z, a-z, 0-9 and _
std::string expandEnvironmentVariables(const std::string &s); NLMISC_API std::string expandEnvironmentVariables(const std::string &s);
/// Functions to convert a string with arguments to array or array to string (will espace strings with spaces) /// Functions to convert a string with arguments to array or array to string (will espace strings with spaces)
bool explodeArguments(const std::string &str, std::vector<std::string> &args); bool explodeArguments(const std::string &str, std::vector<std::string> &args);
std::string joinArguments(const std::vector<std::string> &args); NLMISC_API std::string joinArguments(const std::vector<std::string> &args);
/// Escape an argument to not evaluate environment variables or special cases /// Escape an argument to not evaluate environment variables or special cases
std::string escapeArgument(const std::string &arg); NLMISC_API std::string escapeArgument(const std::string &arg);
/// This function kills a program using his pid (on unix, it uses the kill() POSIX function) /// This function kills a program using his pid (on unix, it uses the kill() POSIX function)
bool killProgram(uint32 pid); NLMISC_API bool killProgram(uint32 pid);
/// This function kills a program using his pid with abort signal (on unix, it uses the kill() POSIX function) /// This function kills a program using his pid with abort signal (on unix, it uses the kill() POSIX function)
bool abortProgram(uint32 pid); NLMISC_API bool abortProgram(uint32 pid);
/** Returns a string corresponding to the class T in string format. /** Returns a string corresponding to the class T in string format.
* Example: * Example:
@ -704,10 +704,10 @@ operator<<(std::basic_ostream<_CharT, _Traits>& __os, const sint64& __z)
class CLog; class CLog;
/// Display the bits (with 0 and 1) composing a byte (from right to left) /// Display the bits (with 0 and 1) composing a byte (from right to left)
void displayByteBits( uint8 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log ); NLMISC_API void displayByteBits(uint8 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log);
/// Display the bits (with 0 and 1) composing a number (uint32) (from right to left) /// Display the bits (with 0 and 1) composing a number (uint32) (from right to left)
void displayDwordBits( uint32 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log ); NLMISC_API void displayDwordBits(uint32 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log);
/// this wrapping is due to a visual bug when calling isprint with big value /// this wrapping is due to a visual bug when calling isprint with big value
/// example of crash with VC6 SP4: int a = isprint(0x40e208); /// example of crash with VC6 SP4: int a = isprint(0x40e208);
@ -722,10 +722,10 @@ inline int nlisprint(int c)
#endif #endif
// Open an url in a browser // Open an url in a browser
bool openURL (const std::string &url); NLMISC_API bool openURL(const std::string &url);
// Open a document // Open a document
bool openDoc (const std::string &document); NLMISC_API bool openDoc(const std::string &document);
// AntiBug method that return an epsilon if x==0, else x // AntiBug method that return an epsilon if x==0, else x
inline float favoid0(float x) inline float favoid0(float x)

@ -107,7 +107,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CConfigFile class NLMISC_API CConfigFile
{ {
public: public:
@ -120,7 +120,7 @@ public:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
struct CVar struct NLMISC_API CVar
{ {
public: public:

@ -40,7 +40,7 @@ namespace NLMISC
* \date 2004 * \date 2004
* *
*/ */
class CContiguousBlockAllocator class NLMISC_API CContiguousBlockAllocator
{ {
public: public:
// ctor // ctor

@ -35,7 +35,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2004 * \date 2004
*/ */
class CCPUTimeStat class NLMISC_API CCPUTimeStat
{ {
public: public:

@ -45,7 +45,7 @@ namespace NLMISC
* Btw the method is optimized like this (1 call instead of 3 (and one with virtual)) because we added a local cache (_Log) * Btw the method is optimized like this (1 call instead of 3 (and one with virtual)) because we added a local cache (_Log)
* Thus it is much better like this. * Thus it is much better like this.
*/ */
class CImposterLog class NLMISC_API CImposterLog
{ {
private: private:
typedef CLog *(INelContext::*TAccessor)(); typedef CLog *(INelContext::*TAccessor)();
@ -66,14 +66,14 @@ public:
// NOTE: The following are all NULL until createDebug() has been called at least once // NOTE: The following are all NULL until createDebug() has been called at least once
// NOTE2: You must not use this class before the main() (not inside a static class ctor) // NOTE2: You must not use this class before the main() (not inside a static class ctor)
extern CImposterLog ErrorLog; NLMISC_API extern CImposterLog ErrorLog;
extern CImposterLog WarningLog; NLMISC_API extern CImposterLog WarningLog;
extern CImposterLog InfoLog; NLMISC_API extern CImposterLog InfoLog;
extern CImposterLog DebugLog; NLMISC_API extern CImposterLog DebugLog;
extern CImposterLog AssertLog; NLMISC_API extern CImposterLog AssertLog;
extern CMemDisplayer *DefaultMemDisplayer; NLMISC_API extern CMemDisplayer *DefaultMemDisplayer;
extern CMsgBoxDisplayer *DefaultMsgBoxDisplayer; NLMISC_API extern CMsgBoxDisplayer *DefaultMsgBoxDisplayer;
// //
@ -81,36 +81,36 @@ extern CMsgBoxDisplayer *DefaultMsgBoxDisplayer;
// //
// internal use only // internal use only
void createDebug (const char *logPath = NULL, bool logInFile = true, bool eraseLastLog = false); NLMISC_API void createDebug(const char *logPath = NULL, bool logInFile = true, bool eraseLastLog = false);
/// Do not call this, unless you know what you're trying to do (it kills debug)! /// Do not call this, unless you know what you're trying to do (it kills debug)!
void destroyDebug(); NLMISC_API void destroyDebug();
// call this if you want to change the dir of the log.log file // call this if you want to change the dir of the log.log file
void changeLogDirectory(const std::string &dir); NLMISC_API void changeLogDirectory(const std::string &dir);
// call this if you want to get the dir of the log.log file // call this if you want to get the dir of the log.log file
std::string getLogDirectory(); NLMISC_API std::string getLogDirectory();
// internal breakpoint window // internal breakpoint window
void enterBreakpoint (const char *message); NLMISC_API void enterBreakpoint(const char *message);
// if true, the assert generates an assert // if true, the assert generates an assert
// if false, the assert just displays a warning and continue // if false, the assert just displays a warning and continue
void setAssert (bool assert); NLMISC_API void setAssert(bool assert);
// Beep (Windows only, no effect elsewhere) // Beep (Windows only, no effect elsewhere)
void beep( uint freq, uint duration ); NLMISC_API void beep(uint freq, uint duration);
typedef std::string (*TCrashCallback)(); NLMISC_API typedef std::string (*TCrashCallback)();
// this function enables user application to add information in the log when a crash occurs // this function enables user application to add information in the log when a crash occurs
void setCrashCallback(TCrashCallback crashCallback); NLMISC_API void setCrashCallback(TCrashCallback crashCallback);
// For Crash report window. allow to know if a crash has already raised in the application // For Crash report window. allow to know if a crash has already raised in the application
bool isCrashAlreadyReported(); NLMISC_API bool isCrashAlreadyReported();
void setCrashAlreadyReported(bool state); NLMISC_API void setCrashAlreadyReported(bool state);
// This very amazing macro __FUNCTION__ doesn't exist on VC6, map it to NULL // This very amazing macro __FUNCTION__ doesn't exist on VC6, map it to NULL
@ -175,7 +175,7 @@ void setCrashAlreadyReported(bool state);
# define nldebug 0&& # define nldebug 0&&
# endif # endif
#else // NL_NO_DEBUG #else // NL_NO_DEBUG
extern bool DisableNLDebug; NLMISC_API extern bool DisableNLDebug;
# define nldebug if (NLMISC::DisableNLDebug) {} else (NLMISC::createDebug(), NLMISC::INelContext::getInstance().getDebugLog()->setPosition( __LINE__, __FILE__, __FUNCTION__ ), NLMISC::INelContext::getInstance().getDebugLog())->displayNL # define nldebug if (NLMISC::DisableNLDebug) {} else (NLMISC::createDebug(), NLMISC::INelContext::getInstance().getDebugLog()->setPosition( __LINE__, __FILE__, __FUNCTION__ ), NLMISC::INelContext::getInstance().getDebugLog())->displayNL
#endif // NL_NO_DEBUG #endif // NL_NO_DEBUG
@ -359,9 +359,9 @@ void setCrashAlreadyReported(bool state);
#endif #endif
// Internal, don't use it (make smaller assert code) // Internal, don't use it (make smaller assert code)
extern bool _assert_stop(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp); NLMISC_API extern bool _assert_stop(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp);
extern void _assertex_stop_0(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp); NLMISC_API extern void _assertex_stop_0(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp);
extern bool _assertex_stop_1(bool &ignoreNextTime); NLMISC_API extern bool _assertex_stop_1(bool &ignoreNextTime);
// removed because we always check assert (even in release mode) #if defined(NL_DEBUG) // removed because we always check assert (even in release mode) #if defined(NL_DEBUG)
@ -542,10 +542,10 @@ class ETrapDebug : public Exception
/// Get the call stack and set it with result /// Get the call stack and set it with result
void getCallStack(std::string &result, sint skipNFirst = 0); NLMISC_API void getCallStack(std::string &result, sint skipNFirst = 0);
/// Get the call stack and the logs and set it with result /// Get the call stack and the logs and set it with result
void getCallStackAndLog (std::string &result, sint skipNFirst = 0); NLMISC_API void getCallStackAndLog(std::string &result, sint skipNFirst = 0);
/** /**
* safe_cast<>: this is a function which nlassert() a dynamic_cast in Debug, and just do a static_cast in release. * safe_cast<>: this is a function which nlassert() a dynamic_cast in Debug, and just do a static_cast in release.
@ -610,10 +610,10 @@ template<class T, class U> inline T type_cast(U o)
*/ */
// Need a breakpoint in the assert / verify macro // Need a breakpoint in the assert / verify macro
extern bool DebugNeedAssert; NLMISC_API extern bool DebugNeedAssert;
// Internal process, don't use it // Internal process, don't use it
extern bool NoAssert; NLMISC_API extern bool NoAssert;
template<class T> template<class T>
@ -672,7 +672,7 @@ private:
}; };
/// Data for instance counting /// Data for instance counting
struct TInstanceCounterData struct NLMISC_API TInstanceCounterData
{ {
sint32 _InstanceCounter; sint32 _InstanceCounter;
sint32 _DeltaCounter; sint32 _DeltaCounter;
@ -864,20 +864,20 @@ private:
// //
/// Never use this function (internal use only) /// Never use this function (internal use only)
void nlFatalError (const char *format, ...); NLMISC_API void nlFatalError(const char *format, ...);
/// Never use this function but call the nlerror macro (internal use only) /// Never use this function but call the nlerror macro (internal use only)
void nlError (const char *format, ...); NLMISC_API void nlError(const char *format, ...);
#define NL_CRASH_DUMP_FILE "nel_debug.dmp" #define NL_CRASH_DUMP_FILE "nel_debug.dmp"
// Standard API to retrieve error code and test for windows or unix platform // Standard API to retrieve error code and test for windows or unix platform
/// Return the last error code generated by a system call /// Return the last error code generated by a system call
int getLastError(); NLMISC_API int getLastError();
/// Return a readable text according to the error code submited /// Return a readable text according to the error code submited
std::string formatErrorMessage(int errorCode); NLMISC_API std::string formatErrorMessage(int errorCode);
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------

@ -528,21 +528,21 @@ namespace STRING_MANAGER
typedef CMakeDiff<TWorksheet::TRow, TWordsDiffContext, TGetWorksheetIdentifier, TGetWorksheetHashValue, TTestWorksheetItem> TWorkSheetDiff; typedef CMakeDiff<TWorksheet::TRow, TWordsDiffContext, TGetWorksheetIdentifier, TGetWorksheetHashValue, TTestWorksheetItem> TWorkSheetDiff;
uint64 makePhraseHash(const TPhrase &phrase); NLMISC_API uint64 makePhraseHash(const TPhrase &phrase);
bool parseHashFromComment(const ucstring &comments, uint64 &hashValue); NLMISC_API bool parseHashFromComment(const ucstring &comments, uint64 &hashValue);
bool loadStringFile(const std::string filename, std::vector<TStringInfo> &stringInfos, bool forceRehash, ucchar openMark = '[', ucchar closeMark = ']', bool specialCase = false); NLMISC_API bool loadStringFile(const std::string filename, std::vector<TStringInfo> &stringInfos, bool forceRehash, ucchar openMark = '[', ucchar closeMark = ']', bool specialCase = false);
ucstring prepareStringFile(const std::vector<TStringInfo> &strings, bool removeDiffComments, bool noDiffInfo = false); NLMISC_API ucstring prepareStringFile(const std::vector<TStringInfo> &strings, bool removeDiffComments, bool noDiffInfo = false);
bool readPhraseFile(const std::string &filename, std::vector<TPhrase> &phrases, bool forceRehash); NLMISC_API bool readPhraseFile(const std::string &filename, std::vector<TPhrase> &phrases, bool forceRehash);
bool readPhraseFileFromString(ucstring const& doc, const std::string &filename, std::vector<TPhrase> &phrases, bool forceRehash); NLMISC_API bool readPhraseFileFromString(ucstring const &doc, const std::string &filename, std::vector<TPhrase> &phrases, bool forceRehash);
ucstring tabLines(uint nbTab, const ucstring &str); NLMISC_API ucstring tabLines(uint nbTab, const ucstring &str);
ucstring preparePhraseFile(const std::vector<TPhrase> &phrases, bool removeDiffComments); NLMISC_API ucstring preparePhraseFile(const std::vector<TPhrase> &phrases, bool removeDiffComments);
bool loadExcelSheet(const std::string filename, TWorksheet &worksheet, bool checkUnique = true); NLMISC_API bool loadExcelSheet(const std::string filename, TWorksheet &worksheet, bool checkUnique = true);
bool readExcelSheet(const ucstring &text, TWorksheet &worksheet, bool checkUnique = true); NLMISC_API bool readExcelSheet(const ucstring &text, TWorksheet &worksheet, bool checkUnique = true);
void makeHashCode(TWorksheet &sheet, bool forceRehash); NLMISC_API void makeHashCode(TWorksheet &sheet, bool forceRehash);
ucstring prepareExcelSheet(const TWorksheet &worksheet); NLMISC_API ucstring prepareExcelSheet(const TWorksheet &worksheet);
} // namespace STRING_MANAGER } // namespace STRING_MANAGER

@ -37,7 +37,7 @@ class CMutex;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class IDisplayer class NLMISC_API IDisplayer
{ {
public: public:
@ -90,7 +90,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CStdDisplayer : virtual public IDisplayer class NLMISC_API CStdDisplayer : virtual public IDisplayer
{ {
public: public:
CStdDisplayer (const char *displayerName = "") : IDisplayer (displayerName) {} CStdDisplayer (const char *displayerName = "") : IDisplayer (displayerName) {}
@ -110,7 +110,7 @@ protected:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CFileDisplayer : virtual public IDisplayer class NLMISC_API CFileDisplayer : virtual public IDisplayer
{ {
public: public:
@ -147,7 +147,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CMsgBoxDisplayer : virtual public IDisplayer class NLMISC_API CMsgBoxDisplayer : virtual public IDisplayer
{ {
public: public:
CMsgBoxDisplayer (const char *displayerName = "") : IDisplayer (displayerName), IgnoreNextTime(false) {} CMsgBoxDisplayer (const char *displayerName = "") : IDisplayer (displayerName), IgnoreNextTime(false) {}

@ -53,7 +53,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2007 * \date 2007
*/ */
class CDummyWindow class NLMISC_API CDummyWindow
{ {
public: public:
CDummyWindow(); CDummyWindow();

@ -89,7 +89,7 @@ extern "C" \
* \author Nevrax France * \author Nevrax France
* \date 2004 * \date 2004
*/ */
class CLibrary class NLMISC_API CLibrary
{ {
/// Dynamic library handle /// Dynamic library handle
NL_LIB_HANDLE _LibHandle; NL_LIB_HANDLE _LibHandle;
@ -200,7 +200,7 @@ public:
* and to add some hooks for library implementor * and to add some hooks for library implementor
* over library loading/unloading. * over library loading/unloading.
*/ */
class INelLibrary class NLMISC_API INelLibrary
{ {
friend class CLibrary; friend class CLibrary;

@ -30,7 +30,7 @@
namespace NLMISC namespace NLMISC
{ {
class CEntityIdTranslator class NLMISC_API CEntityIdTranslator
{ {
NLMISC_SAFE_SINGLETON_DECL_PTR(CEntityIdTranslator); NLMISC_SAFE_SINGLETON_DECL_PTR(CEntityIdTranslator);
public: public:

@ -30,7 +30,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
struct CEntityId struct NLMISC_API CEntityId
{ {
// pseudo constants // pseudo constants
enum enum

@ -25,7 +25,7 @@ namespace NLMISC
/** /**
* This class performs numerical expression parsing. * This class performs numerical expression parsing.
*/ */
class CEvalNumExpr class NLMISC_API CEvalNumExpr
{ {
public: public:
virtual ~CEvalNumExpr() {} virtual ~CEvalNumExpr() {}

@ -29,7 +29,7 @@ namespace NLMISC {
* This is useful when you don't have the opportunity to register more than * This is useful when you don't have the opportunity to register more than
* one event emitter to an event server. * one event emitter to an event server.
*/ */
class CEventEmitterMulti : public IEventEmitter class NLMISC_API CEventEmitterMulti : public IEventEmitter
{ {
public: public:
/// dtor /// dtor

@ -33,7 +33,7 @@ class CEventServer;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class IEventListener class NLMISC_API IEventListener
{ {
public: public:
@ -77,7 +77,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CEventListenerAsync: public IEventListener class NLMISC_API CEventListenerAsync : public IEventListener
{ {
public: public:

@ -40,7 +40,7 @@ typedef std::multimap<CClassId, IEventListener*, CClassIdHashMapTraits> mapListe
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CEventServer class NLMISC_API CEventServer
{ {
mapListener _Listeners; mapListener _Listeners;
std::list<IEventEmitter*> _Emitters; std::list<IEventEmitter*> _Emitters;

@ -33,7 +33,7 @@ class IEventEmitter;
* CEvent. System event. * CEvent. System event.
* \date 2000 * \date 2000
*/ */
class CEvent : public CClassId class NLMISC_API CEvent : public CClassId
{ {
public: public:
/// Emitter of the event. Can be NULL if the event is posted directly to the CEventServer. /// Emitter of the event. Can be NULL if the event is posted directly to the CEventServer.

@ -25,9 +25,9 @@ namespace NLMISC
{ {
const uint OptFastFloorCWStackSize = 10; const uint OptFastFloorCWStackSize = 10;
extern int OptFastFloorCWStack[OptFastFloorCWStackSize]; NLMISC_API extern int OptFastFloorCWStack[OptFastFloorCWStackSize];
extern int *OptFastFloorCWStackPtr; NLMISC_API extern int *OptFastFloorCWStackPtr;
extern int *OptFastFloorCWStackEnd; NLMISC_API extern int *OptFastFloorCWStackEnd;
// fastFloor function. // fastFloor function.
#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) #if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR)
@ -35,7 +35,7 @@ extern int *OptFastFloorCWStackEnd;
#include <cfloat> #include <cfloat>
// The magic constant value. support both positive and negative numbers. // The magic constant value. support both positive and negative numbers.
extern double OptFastFloorMagicConst ; NLMISC_API extern double OptFastFloorMagicConst;
inline void OptFastFloorPushCW(int ctrl) inline void OptFastFloorPushCW(int ctrl)
{ {

@ -32,7 +32,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CFastMem class NLMISC_API CFastMem
{ {
public: public:

@ -80,7 +80,7 @@ struct ERenameError : public EFile
* It can be loaded/called through CAsyncFileManager for instance * It can be loaded/called through CAsyncFileManager for instance
* *********************************************** * ***********************************************
*/ */
class CIFile : public IStream class NLMISC_API CIFile : public IStream
{ {
public: // Basic Usage. public: // Basic Usage.
/// Object. NB: destructor close() the stream. /// Object. NB: destructor close() the stream.
@ -198,7 +198,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class COFile : public IStream class NLMISC_API COFile : public IStream
{ {
public: // Basic Usage. public: // Basic Usage.
/// Object. NB: destructor close() the stream. /// Object. NB: destructor close() the stream.

@ -37,7 +37,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2004 * \date 2004
*/ */
class CFixedSizeAllocator class NLMISC_API CFixedSizeAllocator
{ {
public: public:
CFixedSizeAllocator(uint numBytesPerBlock, uint numBlockPerChunk); CFixedSizeAllocator(uint numBytesPerBlock, uint numBlockPerChunk);

@ -30,7 +30,7 @@ class CVector2f;
* \author Nevrax France * \author Nevrax France
* \date 2005 * \date 2005
*/ */
class CGridTraversal class NLMISC_API CGridTraversal
{ {
public: public:
/** begin to traverse a grid along the given segments /** begin to traverse a grid along the given segments

@ -34,7 +34,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CHeapMemory class NLMISC_API CHeapMemory
{ {
public: public:

@ -88,7 +88,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CSimpleClock class NLMISC_API CSimpleClock
{ {
public: public:
CSimpleClock() : _NumTicks(0) CSimpleClock() : _NumTicks(0)
@ -175,7 +175,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2001, 2002 * \date 2001, 2002
*/ */
class CHTimer class NLMISC_API CHTimer
{ {
public: public:
// this enum is used to sort displayed results // this enum is used to sort displayed results

@ -60,7 +60,7 @@ namespace NLMISC {
* \date 2000 * \date 2000
*/ */
class CI18N class NLMISC_API CI18N
{ {
public: public:

@ -84,7 +84,7 @@ struct EXmlParsingError : public EStream
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CIXml : public IStream class NLMISC_API CIXml : public IStream
{ {
friend void xmlGenericErrorFuncRead (void *ctx, const char *msg, ...); friend void xmlGenericErrorFuncRead (void *ctx, const char *msg, ...);
public: public:

@ -78,7 +78,7 @@ namespace NLMISC
* . * .
*/ */
class CInterWindowMsgQueue class NLMISC_API CInterWindowMsgQueue
{ {
public: public:
CInterWindowMsgQueue(); CInterWindowMsgQueue();

@ -33,7 +33,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CLine class NLMISC_API CLine
{ {
public: public:
CVector V0, V1; CVector V0, V1;

@ -40,7 +40,8 @@ class IDisplayer;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CLog { class NLMISC_API CLog
{
public: public:
typedef enum { LOG_NO=0, LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUG, LOG_STAT, LOG_ASSERT, LOG_UNKNOWN } TLogType; typedef enum { LOG_NO=0, LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUG, LOG_STAT, LOG_ASSERT, LOG_UNKNOWN } TLogType;

@ -54,7 +54,7 @@ class CPlane;
* \date 2000 * \date 2000
*/ */
class NL_ALIGN_SSE2 CMatrix class NLMISC_API NL_ALIGN_SSE2 CMatrix
{ {
public: public:
/// Rotation Order. /// Rotation Order.
@ -356,7 +356,7 @@ public:
// Friend. // Friend.
/// Plane (line vector) multiplication. /// Plane (line vector) multiplication.
friend CPlane operator*(const CPlane &p, const CMatrix &m); NLMISC_API friend CPlane operator*(const CPlane &p, const CMatrix &m);
private: private:

@ -59,7 +59,7 @@ class IStream;
*/ */
// **************************************************************************** // ****************************************************************************
struct CHashKeyMD5 struct NLMISC_API CHashKeyMD5
{ {
uint8 Data[16]; uint8 Data[16];
@ -74,7 +74,7 @@ struct CHashKeyMD5
}; };
// **************************************************************************** // ****************************************************************************
class CMD5Context class NLMISC_API CMD5Context
{ {
public: public:
@ -117,10 +117,10 @@ inline bool operator <(const struct CHashKeyMD5 &a,const struct CHashKeyMD5 &b)
*/ */
// This function get a filename (it works with big files) and returns his MD5 hash key // This function get a filename (it works with big files) and returns his MD5 hash key
CHashKeyMD5 getMD5(const std::string &filename); NLMISC_API CHashKeyMD5 getMD5(const std::string &filename);
// This function get a buffer with size and returns his MD5 hash key // This function get a buffer with size and returns his MD5 hash key
CHashKeyMD5 getMD5(const uint8 *buffer, uint32 size); NLMISC_API CHashKeyMD5 getMD5(const uint8 *buffer, uint32 size);
}; // namespace NLMISC }; // namespace NLMISC

@ -33,7 +33,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CMemDisplayer : public IDisplayer class NLMISC_API CMemDisplayer : public IDisplayer
{ {
public: public:
/// Constructor /// Constructor
@ -72,7 +72,7 @@ protected:
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CLightMemDisplayer : public CMemDisplayer class NLMISC_API CLightMemDisplayer : public CMemDisplayer
{ {
public: public:
/// Constructor /// Constructor

@ -130,7 +130,7 @@ public:
* \author Nevrax France * \author Nevrax France
* \date 2000, 2002 * \date 2000, 2002
*/ */
class CMemStream : public NLMISC::IStream class NLMISC_API CMemStream : public NLMISC::IStream
{ {
public: public:

@ -33,7 +33,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 1/2004 * \date 1/2004
*/ */
class CMouseSmoother class NLMISC_API CMouseSmoother
{ {
public: public:
// create a mouse smoother with the given sampling period. // create a mouse smoother with the given sampling period.

@ -84,7 +84,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CUnfairMutex class NLMISC_API CUnfairMutex
{ {
public: public:
@ -424,7 +424,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CSharedMutex class NLMISC_API CSharedMutex
{ {
public: public:
@ -504,7 +504,7 @@ struct TNelRtlCriticalSection {
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CFairMutex class NLMISC_API CFairMutex
{ {
public: public:

@ -22,14 +22,9 @@
#include "stream.h" #include "stream.h"
#include "rgba.h" #include "rgba.h"
namespace NLMISC namespace NLMISC
{ {
// *************************************************************************** // ***************************************************************************
/** /**
* A class which generate noisy value, according to a position * A class which generate noisy value, according to a position
@ -37,7 +32,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CNoiseValue class NLMISC_API CNoiseValue
{ {
public: public:
float Abs; float Abs;
@ -77,7 +72,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CNoiseColorGradient class NLMISC_API CNoiseColorGradient
{ {
public: public:
/// Abs and Rand should be 0 and 1 here. If not, some colors may not be generated... /// Abs and Rand should be 0 and 1 here. If not, some colors may not be generated...
@ -96,10 +91,8 @@ public:
}; };
} // NL3D } // NL3D
#endif // NL_NOISE_VALUE_H #endif // NL_NOISE_VALUE_H
/* End of noise_value.h */ /* End of noise_value.h */

@ -76,7 +76,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class COXml : public IStream class NLMISC_API COXml : public IStream
{ {
friend int xmlOutputWriteCallbackForNeL ( void *context, const char *buffer, int len ); friend int xmlOutputWriteCallbackForNeL ( void *context, const char *buffer, int len );
friend int xmlOutputCloseCallbackForNeL ( void *context ); friend int xmlOutputCloseCallbackForNeL ( void *context );

@ -35,7 +35,7 @@ class CFixedSizeAllocator;
* \author Nevrax France * \author Nevrax France
* \date 2004 * \date 2004
*/ */
class CObjectArenaAllocator class NLMISC_API CObjectArenaAllocator
{ {
public: public:
/** ctor /** ctor

@ -40,7 +40,7 @@ struct EPathNotFound : public Exception
* \warning addSearchPath(), clearMap() and remapExtension() are not reentrant. * \warning addSearchPath(), clearMap() and remapExtension() are not reentrant.
* \warning all path and files are *case sensitive* on linux. * \warning all path and files are *case sensitive* on linux.
*/ */
class CFileContainer class NLMISC_API CFileContainer
{ {
// no copy allowed // no copy allowed
CFileContainer(const CFileContainer &/* other */) CFileContainer(const CFileContainer &/* other */)
@ -336,7 +336,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CPath class NLMISC_API CPath
{ {
NLMISC_SAFE_SINGLETON_DECL_PTR(CPath); NLMISC_SAFE_SINGLETON_DECL_PTR(CPath);
public: public:
@ -568,7 +568,7 @@ private:
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
struct CFile struct NLMISC_API CFile
{ {
/** /**
* Retrieve the associated file name. * Retrieve the associated file name.

@ -38,7 +38,7 @@ class CUV;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CPlane class NLMISC_API CPlane
{ {
public: public:
float a,b,c,d; float a,b,c,d;

@ -41,7 +41,7 @@ class CBSPNode2v;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CPolygon class NLMISC_API CPolygon
{ {
public: public:
std::vector<CVector> Vertices; std::vector<CVector> Vertices;
@ -116,7 +116,7 @@ public:
/** /**
* A 2d convex polygon * A 2d convex polygon
*/ */
class CPolygon2D class NLMISC_API CPolygon2D
{ {
public: public:
typedef std::vector<CVector2f> TVec2fVect; typedef std::vector<CVector2f> TVec2fVect;
@ -223,8 +223,8 @@ private:
}; };
// comparison of 2D polygon // comparison of 2D polygon
bool operator == (const CPolygon2D &lhs, const CPolygon2D &rhs); NLMISC_API bool operator==(const CPolygon2D &lhs, const CPolygon2D &rhs);
bool operator < (const CPolygon2D &lhs, const CPolygon2D &rhs); NLMISC_API bool operator<(const CPolygon2D &lhs, const CPolygon2D &rhs);
} // NLMISC } // NLMISC

@ -29,7 +29,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class IProgressCallback class NLMISC_API IProgressCallback
{ {
public: public:

@ -39,7 +39,7 @@ const double QuatEpsilon= 0.000001;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
struct CAngleAxis struct NLMISC_API CAngleAxis
{ {
CVector Axis; /// an axis. CVector Axis; /// an axis.
float Angle; /// angle in radians. float Angle; /// angle in radians.
@ -488,7 +488,7 @@ void CQuatT<T>::makeClosest(const CQuatT<T> &o)
class CQuat : public CQuatT<float> class CQuat : public CQuatT<float>
{ {
public: public:
static const CQuat Identity; NLMISC_API static const CQuat Identity;
/// \name Object /// \name Object
// @{ // @{
@ -515,7 +515,7 @@ public:
class CQuatD : public CQuatT<double> class CQuatD : public CQuatT<double>
{ {
public: public:
static const CQuatD Identity; NLMISC_API static const CQuatD Identity;
/// \name Object /// \name Object
// @{ // @{

@ -29,7 +29,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CReaderWriter class NLMISC_API CReaderWriter
{ {
private: private:

@ -31,7 +31,7 @@ class CVector2f;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CRect class NLMISC_API CRect
{ {
public: public:
/// default ctor /// default ctor

@ -49,10 +49,10 @@ enum TReportResult
* *
* \return the button clicked or defaultResult * \return the button clicked or defaultResult
*/ */
TReportResult report(const std::string &title, const std::string &subject, const std::string &body, const std::string &attachment, bool synchronous, bool sendReport, TReportResult defaultResult); NLMISC_API TReportResult report(const std::string &title, const std::string &subject, const std::string &body, const std::string &attachment, bool synchronous, bool sendReport, TReportResult defaultResult);
/// Set the Url of the web service used to post crash reports to. String is copied /// Set the Url of the web service used to post crash reports to. String is copied
void setReportPostUrl(const char *postUrl); NLMISC_API void setReportPostUrl(const char *postUrl);
} // NLMISC } // NLMISC

@ -34,7 +34,7 @@ class IStream;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CRGBA class NLMISC_API CRGBA
{ {
public: public:
@ -386,7 +386,7 @@ public:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CBGRA class NLMISC_API CBGRA
{ {
public: public:
@ -495,7 +495,7 @@ inline CRGBA blend(CRGBA c0, CRGBA c1, U blendFactor)
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CRGBAF class NLMISC_API CRGBAF
{ {
public: public:
/// Default constructor. do nothing /// Default constructor. do nothing

@ -101,12 +101,12 @@ inline bool operator <(const struct CHashKey &a,const struct CHashKey &b)
// This function get a filename (it works with big files) and returns his SHA hash key // This function get a filename (it works with big files) and returns his SHA hash key
// when forcePath is true, it doesn't use NLMISC::lookup // when forcePath is true, it doesn't use NLMISC::lookup
CHashKey getSHA1(const std::string &filename, bool forcePath = false); NLMISC_API CHashKey getSHA1(const std::string &filename, bool forcePath = false);
// This function get a buffer with size and returns his SHA hash key // This function get a buffer with size and returns his SHA hash key
CHashKey getSHA1(const uint8 *buffer, uint32 size); NLMISC_API CHashKey getSHA1(const uint8 *buffer, uint32 size);
// This function get a buffer and key with size and returns his HMAC-SHA1 hash key // This function get a buffer and key with size and returns his HMAC-SHA1 hash key
CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len); NLMISC_API CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len);
#endif // NL_SHA1_H #endif // NL_SHA1_H

@ -56,7 +56,7 @@ typedef key_t TSharedMemId;
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CSharedMemory class NLMISC_API CSharedMemory
{ {
public: public:

@ -43,7 +43,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CSheetId class NLMISC_API CSheetId
{ {
public : public :

@ -41,7 +41,7 @@ class CRefCount
{ {
public: public:
/// Destructor which release pinfo if necessary. /// Destructor which release pinfo if necessary.
~CRefCount(); NLMISC_API ~CRefCount();
/// Default constructor init crefs to 0. /// Default constructor init crefs to 0.
CRefCount() { crefs = 0; pinfo = &NullPtrInfo; } CRefCount() { crefs = 0; pinfo = &NullPtrInfo; }
@ -63,7 +63,7 @@ public:
}; };
// OWN null for ref ptr. (Optimisations!!!) // OWN null for ref ptr. (Optimisations!!!)
static CPtrInfoBase NullPtrInfo; NLMISC_API static CPtrInfoBase NullPtrInfo;
friend struct CPtrInfo; friend struct CPtrInfo;
// for special case use only. // for special case use only.

@ -41,167 +41,167 @@ typedef std::vector<CSString> CVectorSString;
* \author Nevrax * \author Nevrax
* \date 2003 * \date 2003
*/ */
class CSString: public std::string class CSString : public std::string
{ {
public: public:
/// ctor /// ctor
CSString(); NLMISC_API CSString();
/// ctor /// ctor
CSString(const char *s); NLMISC_API CSString(const char *s);
/// ctor /// ctor
CSString(const std::string &s); NLMISC_API CSString(const std::string &s);
/// ctor /// ctor
CSString(char c); NLMISC_API CSString(char c);
/// ctor /// ctor
CSString(int i,const char *fmt="%d"); NLMISC_API CSString(int i, const char *fmt = "%d");
/// ctor /// ctor
CSString(uint32 u,const char *fmt="%u"); NLMISC_API CSString(uint32 u, const char *fmt = "%u");
/// ctor /// ctor
CSString(double d,const char *fmt="%f"); NLMISC_API CSString(double d, const char *fmt = "%f");
/// ctor /// ctor
CSString(const char *s,const char *fmt); NLMISC_API CSString(const char *s, const char *fmt);
/// ctor /// ctor
CSString(const std::string &s,const char *fmt); NLMISC_API CSString(const std::string &s, const char *fmt);
/// ctor /// ctor
CSString(const std::vector<NLMISC::CSString>& v,const std::string& separator="\n"); NLMISC_API CSString(const std::vector<NLMISC::CSString> &v, const std::string &separator = "\n");
/// Const [] operator /// Const [] operator
std::string::const_reference operator[](std::string::size_type idx) const; NLMISC_API std::string::const_reference operator[](std::string::size_type idx) const;
/// Non-Const [] operator /// Non-Const [] operator
std::string::reference operator[](std::string::size_type idx); NLMISC_API std::string::reference operator[](std::string::size_type idx);
/// Return the first character, or '\\0' is the string is empty /// Return the first character, or '\\0' is the string is empty
char operator*(); NLMISC_API char operator*();
/// Return the n right hand most characters of a string /// Return the n right hand most characters of a string
char back() const; NLMISC_API char back() const;
/// Return the n left hand most characters of a string /// Return the n left hand most characters of a string
CSString left(uint32 count) const; NLMISC_API CSString left(uint32 count) const;
/// Return the n right hand most characters of a string /// Return the n right hand most characters of a string
CSString right(uint32 count) const; NLMISC_API CSString right(uint32 count) const;
/// Return the string minus the n left hand most characters of a string /// Return the string minus the n left hand most characters of a string
CSString leftCrop(uint32 count) const; NLMISC_API CSString leftCrop(uint32 count) const;
/// Return the string minus the n right hand most characters of a string /// Return the string minus the n right hand most characters of a string
CSString rightCrop(uint32 count) const; NLMISC_API CSString rightCrop(uint32 count) const;
/// Return sub string up to but not including first instance of given character, starting at 'iterator' /// Return sub string up to but not including first instance of given character, starting at 'iterator'
/// on exit 'iterator' indexes first character after extracted string segment /// on exit 'iterator' indexes first character after extracted string segment
CSString splitToWithIterator(char c,uint32& iterator) const; NLMISC_API CSString splitToWithIterator(char c, uint32 &iterator) const;
/// Return sub string up to but not including first instance of given character /// Return sub string up to but not including first instance of given character
CSString splitTo(char c) const; NLMISC_API CSString splitTo(char c) const;
/// Return sub string up to but not including first instance of given character /// Return sub string up to but not including first instance of given character
CSString splitTo(char c,bool truncateThis=false,bool absorbSeparator=true); NLMISC_API CSString splitTo(char c, bool truncateThis = false, bool absorbSeparator = true);
/// Return sub string up to but not including first instance of given character /// Return sub string up to but not including first instance of given character
CSString splitTo(const char *s,bool truncateThis=false); NLMISC_API CSString splitTo(const char *s, bool truncateThis = false);
/// Return sub string up to but not including first non-quote encapsulated '//' /// Return sub string up to but not including first non-quote encapsulated '//'
CSString splitToLineComment(bool truncateThis=false, bool useSlashStringEscape=true); NLMISC_API CSString splitToLineComment(bool truncateThis = false, bool useSlashStringEscape = true);
/// Return sub string from character following first instance of given character on /// Return sub string from character following first instance of given character on
CSString splitFrom(char c) const; NLMISC_API CSString splitFrom(char c) const;
/// Return sub string from character following first instance of given character on /// Return sub string from character following first instance of given character on
CSString splitFrom(const char *s) const; NLMISC_API CSString splitFrom(const char *s) const;
/// Behave like a s strtok() routine, returning the sun string extracted from (and removed from) *this /// Behave like a s strtok() routine, returning the sun string extracted from (and removed from) *this
CSString strtok(const char *separators, NLMISC_API CSString strtok(const char *separators,
bool useSmartExtensions=false, // if true then match brackets etc (and refine with following args) bool useSmartExtensions=false, // if true then match brackets etc (and refine with following args)
bool useAngleBrace=false, // - treat '<' and '>' as brackets bool useAngleBrace=false, // - treat '<' and '>' as brackets
bool useSlashStringEscape=true, // - treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // - treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true); // - treat """" as '"') bool useRepeatQuoteStringEscape=true); // - treat """" as '"')
/// Return first word (blank separated) - can remove extracted word from source string /// Return first word (blank separated) - can remove extracted word from source string
CSString firstWord(bool truncateThis=false); NLMISC_API CSString firstWord(bool truncateThis = false);
/// Return first word (blank separated) /// Return first word (blank separated)
CSString firstWordConst() const; NLMISC_API CSString firstWordConst() const;
/// Return sub string remaining after the first word /// Return sub string remaining after the first word
CSString tailFromFirstWord() const; NLMISC_API CSString tailFromFirstWord() const;
/// Count the number of words in a string /// Count the number of words in a string
uint32 countWords() const; NLMISC_API uint32 countWords() const;
/// Extract the given word /// Extract the given word
CSString word(uint32 idx) const; NLMISC_API CSString word(uint32 idx) const;
/// Return first word or quote-encompassed sub-string - can remove extracted sub-string from source string /// Return first word or quote-encompassed sub-string - can remove extracted sub-string from source string
CSString firstWordOrWords(bool truncateThis=false,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true); NLMISC_API CSString firstWordOrWords(bool truncateThis = false, bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true);
/// Return first word or quote-encompassed sub-string /// Return first word or quote-encompassed sub-string
CSString firstWordOrWordsConst(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; NLMISC_API CSString firstWordOrWordsConst(bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const;
/// Return sub string following first word (or quote-encompassed sub-string) /// Return sub string following first word (or quote-encompassed sub-string)
CSString tailFromFirstWordOrWords(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; NLMISC_API CSString tailFromFirstWordOrWords(bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const;
/// Count the number of words (or quote delimited sub-strings) in a string /// Count the number of words (or quote delimited sub-strings) in a string
uint32 countWordOrWords(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; NLMISC_API uint32 countWordOrWords(bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const;
/// Extract the given words (or quote delimited sub-strings) /// Extract the given words (or quote delimited sub-strings)
CSString wordOrWords(uint32 idx,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; NLMISC_API CSString wordOrWords(uint32 idx, bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const;
/// Return first line - can remove extracted line from source string /// Return first line - can remove extracted line from source string
CSString firstLine(bool truncateThis=false); NLMISC_API CSString firstLine(bool truncateThis = false);
/// Return first line /// Return first line
CSString firstLineConst() const; NLMISC_API CSString firstLineConst() const;
/// Return sub string remaining after the first line /// Return sub string remaining after the first line
CSString tailFromFirstLine() const; NLMISC_API CSString tailFromFirstLine() const;
/// Count the number of lines in a string /// Count the number of lines in a string
uint32 countLines() const; NLMISC_API uint32 countLines() const;
/// Extract the given line /// Extract the given line
CSString line(uint32 idx) const; NLMISC_API CSString line(uint32 idx) const;
/// A handy utility routine for knowing if a character is a white space character or not (' ','\t','\n','\r',26) /// A handy utility routine for knowing if a character is a white space character or not (' ','\t','\n','\r',26)
static bool isWhiteSpace(char c); NLMISC_API static bool isWhiteSpace(char c);
/// Test whether character matches '{', '(','[' or '<' (the '<' test depends on the useAngleBrace parameter /// Test whether character matches '{', '(','[' or '<' (the '<' test depends on the useAngleBrace parameter
static bool isOpeningDelimiter(char c,bool useAngleBrace=false); NLMISC_API static bool isOpeningDelimiter(char c, bool useAngleBrace = false);
/// Test whether character matches '}', ')',']' or '>' (the '>' test depends on the useAngleBrace parameter /// Test whether character matches '}', ')',']' or '>' (the '>' test depends on the useAngleBrace parameter
static bool isClosingDelimiter(char c,bool useAngleBrace=false); NLMISC_API static bool isClosingDelimiter(char c, bool useAngleBrace = false);
/// Test whether character matches '\'' or '\"' /// Test whether character matches '\'' or '\"'
static bool isStringDelimiter(char c); NLMISC_API static bool isStringDelimiter(char c);
/// Tests whether the character 'b' is the closing delimiter or string delimiter corresponding to character 'a' /// Tests whether the character 'b' is the closing delimiter or string delimiter corresponding to character 'a'
static bool isMatchingDelimiter(char a,char b); NLMISC_API static bool isMatchingDelimiter(char a, char b);
/// A handy utility routine for knowing if a character is a valid component of a file name /// A handy utility routine for knowing if a character is a valid component of a file name
static bool isValidFileNameChar(char c); NLMISC_API static bool isValidFileNameChar(char c);
/// A handy utility routine for knowing if a character is a valid first char for a keyword (a..z, '_') /// A handy utility routine for knowing if a character is a valid first char for a keyword (a..z, '_')
static bool isValidKeywordFirstChar(char c); NLMISC_API static bool isValidKeywordFirstChar(char c);
/// A handy utility routine for knowing if a character is a valid subsequent char for a keyword (a..z, '_', '0'..'9') /// A handy utility routine for knowing if a character is a valid subsequent char for a keyword (a..z, '_', '0'..'9')
static bool isValidKeywordChar(char c); NLMISC_API static bool isValidKeywordChar(char c);
/// A handy utility routine for knowing if a character is printable (isValidFileNameChar + more basic punctuation) /// A handy utility routine for knowing if a character is printable (isValidFileNameChar + more basic punctuation)
static bool isPrintable(char c); NLMISC_API static bool isPrintable(char c);
/// A handy utility routine for knowing if a character is a hex digit 0..9, a..f /// A handy utility routine for knowing if a character is a hex digit 0..9, a..f
static bool isHexDigit(char c); NLMISC_API static bool isHexDigit(char c);
/// A handy utility routine for converting a hex digit to a numeric value 0..15 /// A handy utility routine for converting a hex digit to a numeric value 0..15
static char convertHexDigit(char c); NLMISC_API static char convertHexDigit(char c);
// a handy routine that tests whether a given string contains binary characters or not. Only characters>32 + isWhiteSpace() are valid // a handy routine that tests whether a given string contains binary characters or not. Only characters>32 + isWhiteSpace() are valid
bool isValidText(); NLMISC_API bool isValidText();
// a handy routine that tests whether a given string is a valid file name or not // a handy routine that tests whether a given string is a valid file name or not
// "\"hello there\\bla\"" is valid // "\"hello there\\bla\"" is valid
// "hello there\\bla" is not valid - missing quotes // "hello there\\bla" is not valid - missing quotes
// "\"hello there\"\\bla" is not valid - text after quotes // "\"hello there\"\\bla" is not valid - text after quotes
bool isValidFileName() const; NLMISC_API bool isValidFileName() const;
// a second handy routine that tests whether a given string is a valid file name or not // a second handy routine that tests whether a given string is a valid file name or not
// equivalent to ('\"'+*this+'\"').isValidFileName() // equivalent to ('\"'+*this+'\"').isValidFileName()
// "\"hello there\\bla\"" is not valid - too many quotes // "\"hello there\\bla\"" is not valid - too many quotes
// "hello there\\bla" is valid // "hello there\\bla" is valid
bool isValidUnquotedFileName() const; NLMISC_API bool isValidUnquotedFileName() const;
// a handy routine that tests whether or not a given string is a valid keyword // a handy routine that tests whether or not a given string is a valid keyword
bool isValidKeyword() const; NLMISC_API bool isValidKeyword() const;
// a handy routine that tests whether or not a given string is quote encapsulated // a handy routine that tests whether or not a given string is quote encapsulated
bool isQuoted( bool useAngleBrace=false, // treat '<' and '>' as brackets NLMISC_API bool isQuoted(bool useAngleBrace = false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true) const; // treat """" as '"' bool useRepeatQuoteStringEscape=true) const; // treat """" as '"'
/// Search for the closing delimiter matching the opening delimiter at position 'startPos' in the 'this' string /// Search for the closing delimiter matching the opening delimiter at position 'startPos' in the 'this' string
/// on error returns startPos /// on error returns startPos
uint32 findMatchingDelimiterPos(bool useAngleBrace,bool useSlashStringEscape,bool useRepeatQuoteStringEscape,uint32 startPos=0) const; NLMISC_API uint32 findMatchingDelimiterPos(bool useAngleBrace, bool useSlashStringEscape, bool useRepeatQuoteStringEscape, uint32 startPos = 0) const;
/// Extract a chunk from the 'this' string /// Extract a chunk from the 'this' string
/// if first non-blank character is a string delimiter or an opening delimiter then extracts up to the matching closing delimiter /// if first non-blank character is a string delimiter or an opening delimiter then extracts up to the matching closing delimiter
/// in all other cases an empty string is returned /// in all other cases an empty string is returned
/// the return string includes the opening blank characters (it isn't stripped) /// the return string includes the opening blank characters (it isn't stripped)
CSString matchDelimiters(bool truncateThis=false, NLMISC_API CSString matchDelimiters(bool truncateThis = false,
bool useAngleBrace=false, // treat '<' and '>' as brackets bool useAngleBrace=false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true); // treat """" as '"' bool useRepeatQuoteStringEscape=true); // treat """" as '"'
/// copy out section of string up to separator character, respecting quotes (but not brackets etc) /// copy out section of string up to separator character, respecting quotes (but not brackets etc)
/// on error tail after returned string doesn't begin with valid separator character /// on error tail after returned string doesn't begin with valid separator character
CSString splitToStringSeparator( char separator, NLMISC_API CSString splitToStringSeparator(char separator,
bool truncateThis=false, bool truncateThis=false,
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true, // treat """" as '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"'
@ -210,14 +210,14 @@ public:
/// copy out section of string up to separator character, respecting quotes, brackets, etc /// copy out section of string up to separator character, respecting quotes, brackets, etc
/// on error tail after returned string doesn't begin with valid separator character /// on error tail after returned string doesn't begin with valid separator character
/// eg: splitToSeparator(','); - this might be used to split some sort of ',' separated input /// eg: splitToSeparator(','); - this might be used to split some sort of ',' separated input
CSString splitToSeparator( char separator, NLMISC_API CSString splitToSeparator(char separator,
bool truncateThis=false, bool truncateThis=false,
bool useAngleBrace=false, // treat '<' and '>' as brackets bool useAngleBrace=false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true, // treat """" as '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"'
bool truncateSeparatorCharacter=false); // if true tail begins after separator char bool truncateSeparatorCharacter=false); // if true tail begins after separator char
CSString splitToSeparator( char separator, NLMISC_API CSString splitToSeparator(char separator,
bool useAngleBrace=false, // treat '<' and '>' as brackets bool useAngleBrace=false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true) const; // treat """" as '"' bool useRepeatQuoteStringEscape=true) const; // treat """" as '"'
@ -225,7 +225,7 @@ public:
/// copy out section of string up to any of a given set of separator characters, respecting quotes, brackets, etc /// copy out section of string up to any of a given set of separator characters, respecting quotes, brackets, etc
/// on error tail after returned string doesn't begin with valid separator character /// on error tail after returned string doesn't begin with valid separator character
/// eg: splitToOneOfSeparators(",;",true,false,false,true); - this might be used to split a string read from a CSV file /// eg: splitToOneOfSeparators(",;",true,false,false,true); - this might be used to split a string read from a CSV file
CSString splitToOneOfSeparators( const CSString& separators, NLMISC_API CSString splitToOneOfSeparators(const CSString &separators,
bool truncateThis=false, bool truncateThis=false,
bool useAngleBrace=false, // treat '<' and '>' as brackets bool useAngleBrace=false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
@ -233,14 +233,14 @@ public:
bool truncateSeparatorCharacter=false, // if true tail begins after separator char bool truncateSeparatorCharacter=false, // if true tail begins after separator char
bool splitStringAtBrackets=true); // if true consider brackets as breaks in the string bool splitStringAtBrackets=true); // if true consider brackets as breaks in the string
CSString splitToOneOfSeparators( const CSString& separators, NLMISC_API CSString splitToOneOfSeparators(const CSString &separators,
bool useAngleBrace=false, // treat '<' and '>' as brackets bool useAngleBrace=false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true) const; // treat """" as '"' bool useRepeatQuoteStringEscape=true) const; // treat """" as '"'
/// Return true if the string is a single block encompassed by a pair of delimiters /// Return true if the string is a single block encompassed by a pair of delimiters
/// eg: "((a)(b)(c))" or "(abc)" return true wheras "(a)(b)(c)" or "abc" return false /// eg: "((a)(b)(c))" or "(abc)" return true wheras "(a)(b)(c)" or "abc" return false
bool isDelimitedMonoBlock( bool useAngleBrace=false, // treat '<' and '>' as brackets NLMISC_API bool isDelimitedMonoBlock(bool useAngleBrace = false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true // treat """" as '"' bool useRepeatQuoteStringEscape=true // treat """" as '"'
) const; ) const;
@ -248,26 +248,26 @@ public:
/// Return the sub string with leading and trailing delimiters ( such as '(' and ')' or '[' and ']' ) removed /// Return the sub string with leading and trailing delimiters ( such as '(' and ')' or '[' and ']' ) removed
/// if the string isn't a delimited monoblock then the complete string is returned /// if the string isn't a delimited monoblock then the complete string is returned
/// eg "((a)b(c))" returns "(a)b(c)" whereas "(a)b(c)" returns the identical "(a)b(c)" /// eg "((a)b(c))" returns "(a)b(c)" whereas "(a)b(c)" returns the identical "(a)b(c)"
CSString stripBlockDelimiters( bool useAngleBrace=false, // treat '<' and '>' as brackets NLMISC_API CSString stripBlockDelimiters(bool useAngleBrace = false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true // treat """" as '"' bool useRepeatQuoteStringEscape=true // treat """" as '"'
) const; ) const;
/// Append the individual words in the string to the result vector /// Append the individual words in the string to the result vector
/// retuns true on success /// retuns true on success
bool splitWords(CVectorSString& result) const; NLMISC_API bool splitWords(CVectorSString &result) const;
/// Append the individual "wordOrWords" elements in the string to the result vector /// Append the individual "wordOrWords" elements in the string to the result vector
/// retuns true on success /// retuns true on success
bool splitWordOrWords(CVectorSString& result,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; NLMISC_API bool splitWordOrWords(CVectorSString &result, bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const;
/// Append the individual lines in the string to the result vector /// Append the individual lines in the string to the result vector
/// retuns true on success /// retuns true on success
bool splitLines(CVectorSString& result) const; NLMISC_API bool splitLines(CVectorSString &result) const;
/// Append the separator-separated elements in the string to the result vector /// Append the separator-separated elements in the string to the result vector
/// retuns true on success /// retuns true on success
bool splitBySeparator( char separator, CVectorSString& result, NLMISC_API bool splitBySeparator(char separator, CVectorSString &result,
bool useAngleBrace=false, // treat '<' and '>' as brackets bool useAngleBrace=false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true, // treat """" as '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"'
@ -276,7 +276,7 @@ public:
/// Append the separator-separated elements in the string to the result vector /// Append the separator-separated elements in the string to the result vector
/// retuns true on success /// retuns true on success
bool splitByOneOfSeparators( const CSString& separators, CVectorSString& result, NLMISC_API bool splitByOneOfSeparators(const CSString &separators, CVectorSString &result,
bool useAngleBrace=false, // treat '<' and '>' as brackets bool useAngleBrace=false, // treat '<' and '>' as brackets
bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true, // treat """" as '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"'
@ -286,142 +286,142 @@ public:
/// join an array of strings to form a single string (appends to the existing content of this string) /// join an array of strings to form a single string (appends to the existing content of this string)
/// if this string is not empty then a separator is added between this string and the following /// if this string is not empty then a separator is added between this string and the following
const CSString& join(const std::vector<CSString>& strings, const CSString& separator=""); NLMISC_API const CSString &join(const std::vector<CSString> &strings, const CSString &separator = "");
const CSString& join(const std::vector<CSString>& strings, char separator); NLMISC_API const CSString &join(const std::vector<CSString> &strings, char separator);
/// Return a copy of the string with leading and trainling spaces removed /// Return a copy of the string with leading and trainling spaces removed
CSString strip() const; NLMISC_API CSString strip() const;
/// Return a copy of the string with leading spaces removed /// Return a copy of the string with leading spaces removed
CSString leftStrip() const; NLMISC_API CSString leftStrip() const;
/// Return a copy of the string with trainling spaces removed /// Return a copy of the string with trainling spaces removed
CSString rightStrip() const; NLMISC_API CSString rightStrip() const;
/// Making an upper case copy of a string /// Making an upper case copy of a string
CSString toUpper() const; NLMISC_API CSString toUpper() const;
/// Making a lower case copy of a string /// Making a lower case copy of a string
CSString toLower() const; NLMISC_API CSString toLower() const;
/// encapsulate string in quotes, adding escape characters as necessary /// encapsulate string in quotes, adding escape characters as necessary
CSString quote( bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' NLMISC_API CSString quote(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true // treat """" as '"' bool useRepeatQuoteStringEscape=true // treat """" as '"'
) const; ) const;
/// if a string is not already encapsulated in quotes then return quote() else return *this /// if a string is not already encapsulated in quotes then return quote() else return *this
CSString quoteIfNotQuoted( bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' NLMISC_API CSString quoteIfNotQuoted(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true // treat """" as '"' bool useRepeatQuoteStringEscape=true // treat """" as '"'
) const; ) const;
/// if a string is not a single word and is not already encapsulated in quotes then return quote() else return *this /// if a string is not a single word and is not already encapsulated in quotes then return quote() else return *this
CSString quoteIfNotAtomic( bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' NLMISC_API CSString quoteIfNotAtomic(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true // treat """" as '"' bool useRepeatQuoteStringEscape=true // treat """" as '"'
) const; ) const;
/// strip delimiting quotes and clear through escape characters as necessary /// strip delimiting quotes and clear through escape characters as necessary
CSString unquote(bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' NLMISC_API CSString unquote(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"'
bool useRepeatQuoteStringEscape=true // treat """" as '"' bool useRepeatQuoteStringEscape=true // treat """" as '"'
) const; ) const;
/// equivalent to if (isQuoted()) unquote() /// equivalent to if (isQuoted()) unquote()
CSString unquoteIfQuoted(bool useSlashStringEscape=true, NLMISC_API CSString unquoteIfQuoted(bool useSlashStringEscape = true,
bool useRepeatQuoteStringEscape=true bool useRepeatQuoteStringEscape=true
) const; ) const;
/// encode special characters such as quotes, gt, lt, etc to xml encoding /// encode special characters such as quotes, gt, lt, etc to xml encoding
/// the isParameter paramter is true if the string is to be used in an XML parameter block /// the isParameter paramter is true if the string is to be used in an XML parameter block
CSString encodeXML(bool isParameter=false) const; NLMISC_API CSString encodeXML(bool isParameter = false) const;
/// decode special characters such as quotes, gt, lt, etc from xml encoding /// decode special characters such as quotes, gt, lt, etc from xml encoding
CSString decodeXML() const; NLMISC_API CSString decodeXML() const;
/// verifies whether a string contains sub-strings that correspond to xml special character codes /// verifies whether a string contains sub-strings that correspond to xml special character codes
bool isEncodedXML() const; NLMISC_API bool isEncodedXML() const;
/// verifies whether a string contains any XML incompatible characters /// verifies whether a string contains any XML incompatible characters
/// in this case the string can be converted to xml compatible format via encodeXML() /// in this case the string can be converted to xml compatible format via encodeXML()
/// the isParameter paramter is true if the string is to be used in an XML parameter block /// the isParameter paramter is true if the string is to be used in an XML parameter block
bool isXMLCompatible(bool isParameter=false) const; NLMISC_API bool isXMLCompatible(bool isParameter = false) const;
/// Replacing all occurences of one string with another /// Replacing all occurences of one string with another
CSString replace(const char *toFind,const char *replacement) const; NLMISC_API CSString replace(const char *toFind, const char *replacement) const;
/// Find index at which a sub-string starts (case not sensitive) - if sub-string not found then returns string::npos /// Find index at which a sub-string starts (case not sensitive) - if sub-string not found then returns string::npos
std::string::size_type find(const char *toFind, std::string::size_type startLocation=0) const; NLMISC_API std::string::size_type find(const char *toFind, std::string::size_type startLocation = 0) const;
/// Find index at which a sub-string starts (case NOT sensitive) - if sub-string not found then returns string::npos /// Find index at which a sub-string starts (case NOT sensitive) - if sub-string not found then returns string::npos
std::string::size_type findNS(const char *toFind, std::string::size_type startLocation=0) const; NLMISC_API std::string::size_type findNS(const char *toFind, std::string::size_type startLocation = 0) const;
/// Return true if this contains given sub string /// Return true if this contains given sub string
bool contains(const char *toFind) const; NLMISC_API bool contains(const char *toFind) const;
/// Return true if this contains given sub string /// Return true if this contains given sub string
bool contains(int character) const; NLMISC_API bool contains(int character) const;
/// Handy atoi routines... /// Handy atoi routines...
int atoi() const; NLMISC_API int atoi() const;
sint32 atosi() const; NLMISC_API sint32 atosi() const;
uint32 atoui() const; NLMISC_API uint32 atoui() const;
sint64 atoi64() const; NLMISC_API sint64 atoi64() const;
sint64 atosi64() const; NLMISC_API sint64 atosi64() const;
uint64 atoui64() const; NLMISC_API uint64 atoui64() const;
/// A handy atof routine... /// A handy atof routine...
double atof() const; NLMISC_API double atof() const;
/// assignment operator /// assignment operator
CSString& operator=(const char *s); NLMISC_API CSString &operator=(const char *s);
/// assignment operator /// assignment operator
CSString& operator=(const std::string &s); NLMISC_API CSString &operator=(const std::string &s);
/// assignment operator /// assignment operator
CSString& operator=(char c); NLMISC_API CSString &operator=(char c);
/// assignment operator /// assignment operator
CSString& operator=(int i); NLMISC_API CSString &operator=(int i);
/// assignment operator /// assignment operator
CSString& operator=(uint32 u); NLMISC_API CSString &operator=(uint32 u);
/// assignment operator /// assignment operator
CSString& operator=(double d); NLMISC_API CSString &operator=(double d);
/// Case insensitive string compare /// Case insensitive string compare
bool operator==(const CSString &other) const; NLMISC_API bool operator==(const CSString &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator==(const std::string &other) const; NLMISC_API bool operator==(const std::string &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator==(const char* other) const; NLMISC_API bool operator==(const char *other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator!=(const CSString &other) const; NLMISC_API bool operator!=(const CSString &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator!=(const std::string &other) const; NLMISC_API bool operator!=(const std::string &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator!=(const char* other) const; NLMISC_API bool operator!=(const char *other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator<=(const CSString &other) const; NLMISC_API bool operator<=(const CSString &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator<=(const std::string &other) const; NLMISC_API bool operator<=(const std::string &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator<=(const char* other) const; NLMISC_API bool operator<=(const char *other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator>=(const CSString &other) const; NLMISC_API bool operator>=(const CSString &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator>=(const std::string &other) const; NLMISC_API bool operator>=(const std::string &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator>=(const char* other) const; NLMISC_API bool operator>=(const char *other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator>(const CSString &other) const; NLMISC_API bool operator>(const CSString &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator>(const std::string &other) const; NLMISC_API bool operator>(const std::string &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator>(const char* other) const; NLMISC_API bool operator>(const char *other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator<(const CSString &other) const; NLMISC_API bool operator<(const CSString &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator<(const std::string &other) const; NLMISC_API bool operator<(const std::string &other) const;
/// Case insensitive string compare /// Case insensitive string compare
bool operator<(const char* other) const; NLMISC_API bool operator<(const char *other) const;
//@{ //@{
//@name Easy concatenation operator to build strings //@name Easy concatenation operator to build strings
@ -466,22 +466,22 @@ public:
//@} //@}
/// Case insensitive string compare (useful for use as map keys, see less<CSString> below) /// Case insensitive string compare (useful for use as map keys, see less<CSString> below)
bool icompare(const std::string &other) const; NLMISC_API bool icompare(const std::string &other) const;
/// Serial /// Serial
void serial( NLMISC::IStream& s ); NLMISC_API void serial(NLMISC::IStream &s);
/// Read a text file into a string /// Read a text file into a string
bool readFromFile(const CSString& fileName); NLMISC_API bool readFromFile(const CSString &fileName);
/// Write a string to a text file /// Write a string to a text file
// returns true on success, false on failure // returns true on success, false on failure
bool writeToFile(const CSString& fileName) const; NLMISC_API bool writeToFile(const CSString &fileName) const;
/// Write a string to a text file /// Write a string to a text file
// if the file already exists and its content is identicall to our own then it is not overwritten // if the file already exists and its content is identicall to our own then it is not overwritten
// returns true on success (including the case where the file exists and is not overwritten), false on failure // returns true on success (including the case where the file exists and is not overwritten), false on failure
bool writeToFileIfDifferent(const CSString& fileName) const; NLMISC_API bool writeToFileIfDifferent(const CSString &fileName) const;
}; };

@ -37,7 +37,7 @@ typedef uint32 TMsDuration;
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CStopWatch class NLMISC_API CStopWatch
{ {
public: public:

@ -74,9 +74,9 @@ struct EStream : public Exception
EStream( const std::string& str ) : Exception( str ) {} EStream( const std::string& str ) : Exception( str ) {}
EStream( const IStream &f ); NLMISC_API EStream(const IStream &f);
EStream( const IStream &f, const std::string& str ); NLMISC_API EStream(const IStream &f, const std::string &str);
virtual ~EStream() throw() {} virtual ~EStream() throw() {}
@ -194,7 +194,7 @@ class IStreamable;
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class IStream class NLMISC_API IStream
{ {
public: public:
/** /**

@ -28,8 +28,8 @@ namespace NLMISC
{ {
// get a string and add \r before \n if necessary // get a string and add \r before \n if necessary
std::string addSlashR (const std::string &str); NLMISC_API std::string addSlashR(const std::string &str);
std::string removeSlashR (const std::string &str); NLMISC_API std::string removeSlashR(const std::string &str);
/** /**
* \def MaxCStringSize * \def MaxCStringSize
@ -81,7 +81,7 @@ _dest = _cstring
* \param count Size of the buffer * \param count Size of the buffer
* \param format of the string, it must be the last argument before the \c '...' * \param format of the string, it must be the last argument before the \c '...'
*/ */
sint smprintf( char *buffer, size_t count, const char *format, ... ); NLMISC_API sint smprintf(char *buffer, size_t count, const char *format, ...);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -246,7 +246,7 @@ inline bool fromString(const std::string &str, double &val) { bool ret = sscanf(
// (str[0] == '1' || (str[0] & 0xD2) == 0x50) // (str[0] == '1' || (str[0] & 0xD2) == 0x50)
// - Kaetemi // - Kaetemi
bool fromString(const std::string &str, bool &val); NLMISC_API bool fromString(const std::string &str, bool &val);
inline bool fromString(const std::string &str, std::string &val) { val = str; return true; } inline bool fromString(const std::string &str, std::string &val) { val = str; return true; }
@ -260,30 +260,30 @@ inline bool fromString(const std::string &str, sint &val) { return sscanf(str.c_
// Convert local codepage to UTF-8 // Convert local codepage to UTF-8
// On Windows, the local codepage is undetermined // On Windows, the local codepage is undetermined
// On Linux, the local codepage is always UTF-8 (no-op) // On Linux, the local codepage is always UTF-8 (no-op)
std::string mbcsToUtf8(const char *str, size_t len = 0); NLMISC_API std::string mbcsToUtf8(const char *str, size_t len = 0);
std::string mbcsToUtf8(const std::string &str); NLMISC_API std::string mbcsToUtf8(const std::string &str);
// Convert wide codepage to UTF-8 // Convert wide codepage to UTF-8
// On Windows, the wide codepage is UTF-16 // On Windows, the wide codepage is UTF-16
// On Linux, the wide codepage is UTF-32 // On Linux, the wide codepage is UTF-32
std::string wideToUtf8(const wchar_t *str, size_t len = 0); NLMISC_API std::string wideToUtf8(const wchar_t *str, size_t len = 0);
std::string wideToUtf8(const std::wstring &str); NLMISC_API std::string wideToUtf8(const std::wstring &str);
// Convert UTF-8 to wide character set // Convert UTF-8 to wide character set
std::wstring utf8ToWide(const char *str, size_t len = 0); NLMISC_API std::wstring utf8ToWide(const char *str, size_t len = 0);
std::wstring utf8ToWide(const std::string &str); NLMISC_API std::wstring utf8ToWide(const std::string &str);
// Convert UTF-8 to local multibyte character set // Convert UTF-8 to local multibyte character set
std::string utf8ToMbcs(const char *str, size_t len = 0); NLMISC_API std::string utf8ToMbcs(const char *str, size_t len = 0);
std::string utf8ToMbcs(const std::string &str); NLMISC_API std::string utf8ToMbcs(const std::string &str);
// Convert wide to local multibyte character set // Convert wide to local multibyte character set
std::string wideToMbcs(const wchar_t *str, size_t len = 0); NLMISC_API std::string wideToMbcs(const wchar_t *str, size_t len = 0);
std::string wideToMbcs(const std::wstring &str); NLMISC_API std::string wideToMbcs(const std::wstring &str);
// Convert local multibyte to wide character set // Convert local multibyte to wide character set
std::wstring mbcsToWide(const char *str, size_t len = 0); NLMISC_API std::wstring mbcsToWide(const char *str, size_t len = 0);
std::wstring mbcsToWide(const std::string &str); NLMISC_API std::wstring mbcsToWide(const std::string &str);
inline const char *asCStr(const char *str) { return str; } inline const char *asCStr(const char *str) { return str; }
inline const char *asCStr(const std::string &str) { return str.c_str(); } inline const char *asCStr(const std::string &str) { return str.c_str(); }

@ -60,7 +60,7 @@ struct CStringIdHashMapTraits
* \author Nevrax France * \author Nevrax France
* \date 2003 * \date 2003
*/ */
class CStringMapper class NLMISC_API CStringMapper
{ {
class CCharComp class CCharComp
{ {
@ -132,7 +132,7 @@ typedef uint TSStringId;
* \author Nevrax France * \author Nevrax France
* \date November 2003 * \date November 2003
*/ */
class CStaticStringMapper class NLMISC_API CStaticStringMapper
{ {
std::map<std::string, TSStringId> _TempStringTable; std::map<std::string, TSStringId> _TempStringTable;

@ -30,7 +30,7 @@ namespace NLMISC {
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CSystemInfo class NLMISC_API CSystemInfo
{ {
public: public:

@ -28,7 +28,7 @@ namespace NLMISC
* \author Kervala * \author Kervala
* \date 2010 * \date 2010
*/ */
class CSystemUtils class NLMISC_API CSystemUtils
{ {
static nlWindow s_window; static nlWindow s_window;
public: public:

@ -44,7 +44,7 @@ public:
* \author Nevrax France * \author Nevrax France
* \date 2000 * \date 2000
*/ */
class CTaskManager : public IRunnable class NLMISC_API CTaskManager : public IRunnable
{ {
public: public:

@ -34,7 +34,7 @@ namespace NLMISC
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CTDS class NLMISC_API CTDS
{ {
public: public:

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save