/**
 * \file CharString.h
 * \date 12.02.2002
 *
 * Interface for the CharString class
 */

#ifndef SUPORT_CHARSTRING_H
#define SUPORT_CHARSTRING_H

#include <stdlib.h>

/**
 * \class CharString
 * \author Marek Lehuta
 * \brief String encapsulation class
 */
class CharString
{
public:
// Construction and destruction
	CharString() { m_pStr = NULL; }
	CharString(const char* pStr);
	CharString(const CharString& str);
	virtual ~CharString();

// Operations
	operator char*();			///< do not store, temporary pointer

	CharString operator+(const char* pStr);
	CharString operator+(const CharString& str);
	friend CharString operator+(const char* pStr, const CharString& str);
	CharString& operator=(const char* pStr);
	CharString& operator=(const CharString& str);

	int operator==(const char* pStr);
	int operator==(const CharString& str);
	friend int operator==(const char* pStr, const CharString& str);

protected:

private:
	char* m_pStr;				///< member string pointer
	char* m_pTmp;				///< temporary string pointer

	CharString(char* pStr, int) { m_pStr = pStr; }

};

#endif // SUPORT_CHARSTRING_H
