source: trunk/nom/idl/nomstring.idl

Last change on this file was 384, checked in by cinc, 17 years ago

Changed some types in method definitions.

File size: 5.3 KB
Line 
1/* ***** BEGIN LICENSE BLOCK *****
2* Version: CDDL 1.0/LGPL 2.1
3*
4* The contents of this file are subject to the COMMON DEVELOPMENT AND
5* DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
6* this file except in compliance with the License. You may obtain a copy of
7* the License at http://www.sun.com/cddl/
8*
9* Software distributed under the License is distributed on an "AS IS" basis,
10* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11* for the specific language governing rights and limitations under the
12* License.
13*
14* The Original Code is "NOM" Netlabs Object Model
15*
16* The Initial Developer of the Original Code is
17* netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
18* Portions created by the Initial Developer are Copyright (C) 2005-2008
19* the Initial Developer. All Rights Reserved.
20*
21* Contributor(s):
22*
23* Alternatively, the contents of this file may be used under the terms of
24* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
25* case the provisions of the LGPL are applicable instead of those above. If
26* you wish to allow use of your version of this file only under the terms of
27* the LGPL, and not to allow others to use your version of this file under
28* the terms of the CDDL, indicate your decision by deleting the provisions
29* above and replace them with the notice and other provisions required by the
30* LGPL. If you do not delete the provisions above, a recipient may use your
31* version of this file under the terms of any one of the CDDL or the LGPL.
32*
33* ***** END LICENSE BLOCK ***** */
34
35#ifndef NOMSTRING_IDL_INCLUDED
36#define NOMSTRING_IDL_INCLUDED
37
38native GString;
39
40#include "nomobj.idl"
41
42NOMCLASSNAME(NOMString);
43
44/** \class NOMString
45 The NOMString class is used for strings which automatically grow or shrink.
46 Methods are provided for common tasks when dealing with strings like inserting or
47 appending strings. A string object never can be empty. It always is a string which may have a length of zero.
48
49 Note that you don't have to delete a NOMString object. This is done by the garbage collector. Deleting
50 it doesn't hurt, though.
51 */
52interface NOMString : NOMObject
53{
54#ifdef __NOM_IDL_COMPILER__
55 filestem=nomstring;
56#endif
57
58 /**
59 The current version of this class is 1.0
60 */
61 NOMCLASSVERSION(1, 0);
62
63 /**
64 Assign a string to this NOMString. An initially created NOMString object is empty.
65 This method can be used to assign some value to it.
66
67 \remark
68 This method does not work on a copy. So by assigning a value to the NOMString the
69 old contents is lost. This may have sideeffects in multithreaded environments if used without care.
70
71 \sa assignCString()
72 */
73 NOMString* assign(in NOMString* nomString);
74
75 /**
76 Assign a C string to this NOMString. An initially created NOMString object is empty.
77 This method can be used to assign some value to it.
78
79 \remark
80 This method does not work on a copy. So by assigning a value to the NOMString the old contents
81 is lost. This may have sideeffects in multithreaded environments if used without care.
82
83 \sa assign()
84 */
85 NOMString* assignString(in string chrString);
86
87 /**
88 Returns the C string holding the info inside the string object. Use with care.
89 In most cases you rather want to use copyCString() instead.
90
91 \return The C string representing the contents of the string object. This is not a copy.
92
93 */
94 string queryString();
95
96 /**
97 Add the NOMString nomString to the end of the string object.
98
99 \remark The returned string object is not newly allocated. Be aware that the string data
100 held by the object is.
101
102 \param nomString A NOMString object to be put at the end of the string.
103 \return
104 Modified NOMString object with the given string object appended. This is not a copy.
105
106 \sa appendCString(), prepend()
107 */
108 NOMString* append(in NOMString* nomString);
109
110 /**
111 Prepend the NOMString \e nomString to the given string object and return the modified
112 NOMString.
113
114 \remark The returned string object is not newly allocated. Be aware that the string data
115 held by the object is.
116
117 \param nomString A NOMString object to be put in front of the string.
118 \return
119 NOMString object with the string prepended. This is not a copy.
120
121 \sa prependCString()
122 */
123 NOMString* prepend(in NOMString* nomString);
124
125
126 /**
127 \return Returns the length of the string in characters.
128 */
129 gulong length();
130
131 /**
132 Cuts off the end of a string leaving the first ulNewLen characters.
133
134 \remark The returned string object is not newly allocated. Be aware that the string data
135 held by the object is.
136
137 \return
138 Truncated NOMString object. This is not a copy.
139 */
140 PNOMString truncate(in gulong ulNewLen);
141
142 /**
143 Create a copy of the NOMString object this method is called on. The caller
144 owns the new NOMString object.
145
146 \return A new NOMString object
147
148 \sa copyCString()
149 */
150 NOMString* copy();
151
152 /**
153 Override of nomInit() to initialize the GString */
154 NOMOVERRIDE(nomInit);
155
156 /**
157 The GString holding the data
158 */
159 NOMINSTANCEVAR(GString* gString);
160};
161
162#endif /* NOMSTRING_IDL_INCLUDED */
Note: See TracBrowser for help on using the repository browser.