~ubuntu-branches/ubuntu/gutsy/libcorelinux/gutsy

« back to all changes in this revision

Viewing changes to corelinux/AbstractString.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2001-12-29 17:43:34 UTC
  • Revision ID: james.westby@ubuntu.com-20011229174334-ejlsuilsiro5vmzr
Tags: 0.4.32-4
* fix config.{guess,sub} out of date on hppa and s390 (closes: #124296,#121830)
* try to be more descriptive in the description of the package  (closes: #115758)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if   !defined(__ABSTRACTSTRING_HPP)
 
2
#define  __ABSTRACTSTRING_HPP
 
3
 
 
4
/*
 
5
  CoreLinux++ 
 
6
  Copyright (C) 1999 CoreLinux Consortium
 
7
  
 
8
   The CoreLinux++ Library is free software; you can redistribute it and/or
 
9
   modify it under the terms of the GNU Library General Public License as
 
10
   published by the Free Software Foundation; either version 2 of the
 
11
   License, or (at your option) any later version.
 
12
 
 
13
   The CoreLinux++ Library Library is distributed in the hope that it will 
 
14
   be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
   Library General Public License for more details.
 
17
 
 
18
   You should have received a copy of the GNU Library General Public
 
19
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 
20
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
21
   Boston, MA 02111-1307, USA.  
 
22
*/
 
23
 
 
24
#if !defined IN_COMMON_HPP
 
25
   #error AbstractString.hpp is included by common.hpp only.
 
26
#endif
 
27
 
 
28
namespace corelinux
 
29
{
 
30
   DECLARE_CLASS( AbstractString );
 
31
 
 
32
   /**
 
33
   AbstractString is a temporary base abstraction. It is the goal
 
34
   of the library to support adaptors for other string implementations
 
35
   while providing a consistent interface.
 
36
   */
 
37
 
 
38
   class AbstractString
 
39
   {
 
40
   public:
 
41
 
 
42
      //
 
43
      // Constructors and destructors
 
44
      //
 
45
 
 
46
                           // Default Constructor
 
47
 
 
48
                           AbstractString( void );
 
49
 
 
50
                           // Copy constructor
 
51
            
 
52
                           AbstractString( AbstractStringCref );
 
53
 
 
54
                           //  Destructor
 
55
 
 
56
      virtual              ~AbstractString( void );
 
57
 
 
58
      //
 
59
      // Operators
 
60
      //
 
61
 
 
62
               // Assignment operator
 
63
 
 
64
               AbstractStringRef operator=( AbstractStringCref ) ;
 
65
 
 
66
               // Equality check
 
67
 
 
68
               bool              operator==( AbstractStringCref ) const;
 
69
 
 
70
 
 
71
      //
 
72
      // Accessors
 
73
      //
 
74
 
 
75
               // Indicates mbcs or unicode based character count
 
76
 
 
77
      virtual  Byte     getElementByteCount( void ) const = 0;
 
78
 
 
79
               // Can it be casted to std::string ?
 
80
 
 
81
      virtual  bool     supportsStandardInterface( void ) const = 0;
 
82
 
 
83
               // Is a mbcs based string?
 
84
 
 
85
      virtual  bool     isUtf8( void ) const = 0;
 
86
 
 
87
               // Is a 16 bit character string?
 
88
 
 
89
      virtual  bool     isUcs2( void ) const = 0;
 
90
 
 
91
               // Is a 32 bit character string (Linux wchar_t)
 
92
 
 
93
      virtual  bool     isUcs4( void ) const = 0;
 
94
 
 
95
      //
 
96
      // Mutators
 
97
      //
 
98
 
 
99
      //
 
100
      // Factory methods and conversions
 
101
      //
 
102
 
 
103
               // Default clone method
 
104
 
 
105
      virtual  AbstractStringPtr clone( void ) const
 
106
                        throw ( Exception ) = 0;
 
107
 
 
108
               // Clone ones self to a Utf8 implementation
 
109
 
 
110
      virtual  AbstractStringPtr cloneUtf8( void ) const 
 
111
                        throw ( Exception ) = 0;
 
112
 
 
113
               // Clone ones self to a Ucs2 implementation
 
114
 
 
115
      virtual  AbstractStringPtr cloneUcs2( void ) const 
 
116
                        throw ( Exception ) = 0;
 
117
 
 
118
               // Clone ones self to a Ucs4 implementation
 
119
 
 
120
      virtual  AbstractStringPtr cloneUcs4( void ) const 
 
121
                        throw ( Exception ) = 0;
 
122
 
 
123
   };
 
124
}
 
125
 
 
126
 
 
127
#endif
 
128
 
 
129
/*
 
130
   Common rcs information do not modify
 
131
   $Author: prudhomm $
 
132
   $Revision: 1.1 $
 
133
   $Date: 2000/04/23 20:43:13 $
 
134
   $Locker:  $
 
135
*/
 
136