// $Source: /usr/local/SimSoft/SoftShop/Basics/Strings/Strings.h,v $
// $Revision: 1.20 $
// $Author: baum $
// $Date: 2001/11/29 15:52:23 $
//
// Login name of the user who locked the revision
// $Locker:  $
// Tag name used to checkout the file
// $Name: Release-20 $
// State assigned to revision
// $State: Exp $
//
//
// $Log: Strings.h,v $
// Revision 1.20  2001/11/29 15:52:23  baum
// -In Kalender.cpp und Kalender.h Handsteuerung eingebaut
//

#ifndef _STRLIB_H
#define _STRLIB_H

#ifdef _STRLIB_CPP
#  undef _impexp
#  define _impexp __declspec(dllexport)
#elif defined BUILD_BASICS_DLL
#  undef _impexp
#  define _impexp  __declspec(dllexport)
#else
#  undef _impexp
#  define _impexp __declspec(dllimport)
#endif

#if defined __GNUG__ || defined __hpux
#  undef _impexp
#  define _impexp
#endif

#include <iostream.h>

//##ModelId=3FBCBCC40157
class _impexp Ustring {

  public:  
    // -----------------------------------------------------------
    // initialisation
    // -----------------------------------------------------------
	//##ModelId=3FBCBCC40167
    Ustring (const char* = NULL);
	//##ModelId=3FBCBCC40169
    Ustring (const Ustring&);
	//##ModelId=3FBCBCC40177
    Ustring (const unsigned);
	//##ModelId=3FBCBCC40179
    Ustring (const int);
	//##ModelId=3FBCBCC4017B
    Ustring (const long);
	//##ModelId=3FBCBCC4017D
    Ustring (const double, unsigned precision = 6);
	//##ModelId=3FBCBCC40187
    ~Ustring ();

    // -----------------------------------------------------------
    // user-functions
    // -----------------------------------------------------------
	//##ModelId=3FBCBCC40188
    char*        str            () const;
	//##ModelId=3FBCBCC4018A
    ostream&     print          (ostream&) const; 
	//##ModelId=3FBCBCC40196
    Ustring      getPart        (unsigned from, unsigned count) const;
	//##ModelId=3FBCBCC4019A
    Ustring&     delPart        (unsigned from, unsigned count);
	//##ModelId=3FBCBCC401A5
    bool         cmpPart        (const Ustring& part, unsigned from) const;
	//##ModelId=3FBCBCC401A9
    Ustring&     overwrite      (const Ustring& istr, unsigned from = 0);
	//##ModelId=3FBCBCC401B5
    Ustring&     insert         (const Ustring& istr, unsigned from = 0);
	//##ModelId=3FBCBCC401B8
    int          findLeftPos    (char c) const;
	//##ModelId=3FBCBCC401BB
    int          findRightPos   (char c) const;
	//##ModelId=3FBCBCC401C7
    int          toUnsigned     (unsigned&) const;  //returns same as sscanf
	//##ModelId=3FBCBCC401CA
    int          toInt          (int&) const;       //returns same as sscanf
	//##ModelId=3FBCBCC401D4
    int          toLong         (long&) const;      //returns same as sscanf
	//##ModelId=3FBCBCC401D7
    int          toFloat        (float&) const;     //returns same as sscanf
	//##ModelId=3FBCBCC401DA
    int          toDouble       (double&) const;    //returns same as sscanf
	//##ModelId=3FBCBCC401E6
    Ustring&     toUpper        ();
	//##ModelId=3FBCBCC401E7
    Ustring&     toLower        ();
	//##ModelId=3FBCBCC401E8
    const unsigned len          () const;
    // -----------------------------------------------------------
    // operators 
    // -----------------------------------------------------------
	//##ModelId=3FBCBCC401F4
    Ustring&	operator =	(const Ustring&);
	//##ModelId=3FBCBCC401F6
    Ustring&	operator =	(const char*); 
	//##ModelId=3FBCBCC401F8
    Ustring	operator +	(const Ustring&) const; 
	//##ModelId=3FBCBCC40204
    Ustring&	operator +=	(const Ustring&); 
	//##ModelId=3FBCBCC40206
    Ustring	operator +	(const char) const; 
	//##ModelId=3FBCBCC40209
    Ustring&	operator +=	(const char); 
	//##ModelId=3FBCBCC40214
    bool	operator ==	(const Ustring&) const; 
	//##ModelId=3FBCBCC40217
    bool	operator !=	(const Ustring&) const; 
	//##ModelId=3FBCBCC40223
    char	operator []     (unsigned int) const;

  private:
	//##ModelId=3FBCBCC40226
    char *ObjStr;
};

_impexp ostream& operator << (ostream&, const Ustring&); 

#endif

