File: UpnpString.h

package info (click to toggle)
pupnp 1%3A1.14.20-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,440 kB
  • sloc: ansic: 34,488; xml: 1,173; cpp: 573; makefile: 341; sh: 130; python: 51; javascript: 7
file content (150 lines) | stat: -rw-r--r-- 3,200 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150


#ifndef STRING_H
#define STRING_H

/*!
 * \defgroup UpnpString The UpnpString Class
 *
 * \brief Implements string operations in the UPnP library.
 *
 * \author Marcelo Roberto Jimenez
 *
 * \version 1.0
 *
 * @{
 *
 * \file
 *
 * \brief UpnpString object declaration.
 */

#include "UpnpGlobal.h" /* for UPNP_EXPORT_SPEC */

#include <stdlib.h> /* for size_t */

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*!
 * \brief Type of the string objects inside libupnp.
 */
typedef struct s_UpnpString UpnpString;

/*!
 * \brief Constructor.
 *
 * \return A pointer to a new allocated object.
 */
UPNP_EXPORT_SPEC UpnpString *UpnpString_new(void);

/*!
 * \brief Destructor.
 */
UPNP_EXPORT_SPEC void UpnpString_delete(
	/*! [in] The \em \b this pointer. */
	UpnpString *p);

/*!
 * \brief Copy Constructor.
 *
 * \return A pointer to a new allocated copy of the original object.
 */
UPNP_EXPORT_SPEC UpnpString *UpnpString_dup(
	/*! [in] The \em \b this pointer. */
	const UpnpString *p);

/*!
 * \brief Assignment operator.
 */
UPNP_EXPORT_SPEC void UpnpString_assign(
	/*! [in] The \em \b this pointer. */
	UpnpString *p,
	/*! [in] The \em \b that pointer. */
	const UpnpString *q);

/*!
 * \brief Returns the length of the string.
 *
 * \return The length of the string.
 * */
UPNP_EXPORT_SPEC size_t UpnpString_get_Length(
	/*! [in] The \em \b this pointer. */
	const UpnpString *p);

/*!
 * \brief Truncates the string to the specified lenght, or does nothing
 * if the current lenght is less than or equal to the requested length.
 * */
UPNP_EXPORT_SPEC void UpnpString_set_Length(
	/*! [in] The \em \b this pointer. */
	UpnpString *p,
	/*! [in] The requested length. */
	size_t n);

/*!
 * \brief Returns the pointer to char.
 *
 * \return The pointer to char.
 */
UPNP_EXPORT_SPEC const char *UpnpString_get_String(
	/*! [in] The \em \b this pointer. */
	const UpnpString *p);

/*!
 * \brief Sets the string from a pointer to char.
 */
UPNP_EXPORT_SPEC int UpnpString_set_String(
	/*! [in] The \em \b this pointer. */
	UpnpString *p,
	/*! [in] (char *) to copy from. */
	const char *s);

/*!
 * \brief Sets the string from a pointer to char using a maximum of N chars.
 */
UPNP_EXPORT_SPEC int UpnpString_set_StringN(
	/*! [in] The \em \b this pointer. */
	UpnpString *p,
	/*! [in] (char *) to copy from. */
	const char *s,
	/*! Maximum number of chars to copy.*/
	size_t n);

/*!
 * \brief Clears the string, sets its size to zero.
 */
UPNP_EXPORT_SPEC void UpnpString_clear(
	/*! [in] The \em \b this pointer. */
	UpnpString *p);

/*!
 * \brief Compares two strings for equality. Case matters.
 *
 * \return The result of strcmp().
 */
UPNP_EXPORT_SPEC int UpnpString_cmp(
	/*! [in] The \em \b the first string. */
	UpnpString *p,
	/*! [in] The \em \b the second string. */
	UpnpString *q);

/*!
 * \brief Compares two strings for equality. Case does not matter.
 *
 * \return The result of strcasecmp().
 */
UPNP_EXPORT_SPEC int UpnpString_casecmp(
	/*! [in] The \em \b the first string. */
	UpnpString *p,
	/*! [in] The \em \b the second string. */
	UpnpString *q);

#ifdef __cplusplus
}
#endif /* __cplusplus */

/* @} UpnpString The UpnpString API */

#endif /* STRING_H */