Click here to Skip to main content
15,893,663 members
Articles / Web Development / HTML

HTML Logger - Portable and Thread-safe

Rate me:
Please Sign up or sign in to vote.
4.73/5 (16 votes)
3 Dec 20021 min read 66K   1.2K   34  
An article on using HTML formatted log in your applications
#ifndef __SMARTSTRING_H__
#define __SMARTSTRING_H__

#include <stdlib.h>

class CSmartString
{
	char *m_pchString;
	int m_iLength;
	int m_iSize;
	bool m_bIsStringStatic;
	
public:
	CSmartString();

	~CSmartString();

	void operator = (CSmartString &NewString);
	void operator = ( const char* szText );

	bool operator == (CSmartString &CmpString);
	bool operator == (const char *pszCmpString);
	operator const char* ();

	bool Reference(CSmartString &ReferenceString);
	bool Construct(int iStringPoolSize, void *pvStringPool = NULL);
	void Destruct();

	bool SetString(const char *pchNewString, int iNewStringLength = -1);
	const char* GetString();
	int GetLength();
	bool IsEmpty();
	void Empty();
	bool AddChar(char chChar);
	bool Compare(const char *pchCmpString, int iCmpStringLength = -1);
	bool Reallocate(int iNewStringSize);

private:
	CSmartString(CSmartString&);

};

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Web Developer
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions