1/*---------------------------------------------------------------------------*
2 *  lstring.h  *
3 *                                                                           *
4 *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
5 *                                                                           *
6 *  Licensed under the Apache License, Version 2.0 (the 'License');          *
7 *  you may not use this file except in compliance with the License.         *
8 *                                                                           *
9 *  You may obtain a copy of the License at                                  *
10 *      http://www.apache.org/licenses/LICENSE-2.0                           *
11 *                                                                           *
12 *  Unless required by applicable law or agreed to in writing, software      *
13 *  distributed under the License is distributed on an 'AS IS' BASIS,        *
14 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
15 *  See the License for the specific language governing permissions and      *
16 *  limitations under the License.                                           *
17 *                                                                           *
18 *---------------------------------------------------------------------------*/
19
20#ifndef __LSTRING_H
21#define __LSTRING_H
22
23
24
25#include "ESR_ReturnCode.h"
26#include "ESR_SharedPrefix.h"
27#include "ptypes.h"
28
29/**
30 * @addtogroup LStringModule LString API functions
31 *
32 * @{
33 */
34
35/**
36 * LString interface.
37 *
38 * @see list of functions used to operate on @ref LStringModule "LString" objects
39 */
40typedef struct LString_t
41{
42  /**
43   * Appends text to LString.
44   *
45   * @param self LString handle
46   * @param value Value to append.
47   */
48  ESR_ReturnCode(*append)(struct LString_t* self, const LCHAR* value);
49  /**
50   * Clears the string contents.
51   *
52   * @param self LString handle
53   */
54  ESR_ReturnCode(*reset)(struct LString_t* self);
55  /**
56   * Destroys LString in favour of static LCHAR* string.
57   * The LString object should not be used past this point.
58   *
59   * @param self LString handle
60   * @param result Resulting LCHAR*
61   */
62  ESR_ReturnCode(*toLCHAR)(struct LString_t* self, LCHAR** result);
63  /**
64   * Destroys LString object.
65   *
66   * @param self LString handle
67   */
68  ESR_ReturnCode(*destroy)(struct LString_t* self);
69}
70LString;
71
72
73
74/**
75 * Creates new LString.
76 *
77 * @param self LString handle
78 */
79ESR_SHARED_API ESR_ReturnCode LStringCreate(LString** self);
80/**
81 * Appends text to LString.
82 *
83 * @param self LString handle
84 * @param value Value to append.
85 */
86ESR_SHARED_API ESR_ReturnCode LStringAppend(LString* self, const LCHAR* value);
87/**
88 * Clears the string contents.
89 *
90 * @param self LString handle
91 */
92ESR_SHARED_API ESR_ReturnCode LStringReset(LString* self);
93/**
94 * Destroys LString in favour of static LCHAR* string.
95 * The LString object should not be used past this point.
96 *
97 * @param self LString handle
98 * @param result Resulting LCHAR*
99 */
100ESR_SHARED_API ESR_ReturnCode LStringToLCHAR(LString* self, LCHAR** result);
101/**
102 * Destroys LString object.
103 *
104 * @param self LString handle
105 */
106ESR_SHARED_API ESR_ReturnCode LStringDestroy(LString* self);
107
108/**
109 * @}
110 */
111
112
113#endif /* __LSTRING_H */
114