UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
UpnpString.hpp
Go to the documentation of this file.
1#ifndef COMPA_UPNPSTRING_HPP
2#define COMPA_UPNPSTRING_HPP
3// Copyright (C) 2021+ GPL 3 and higher by Ingo Höft, <Ingo@Hoeft-online.de>
4// Redistribution only with this Copyright remark. Last modified: 2025-06-12
5// Also Copyright by other contributor as noted below.
6// Last compare with ./Pupnp source file on 2025-05-22, ver 1.14.20
22#include <stddef.h> // For size_t
24
25#ifdef __cplusplus
26extern "C" {
27#endif /* __cplusplus */
28
32// The typedef must be the same as in pupnp otherwise we cannot switch between
33// pupnp gtest and compa gtest. Using the typedef in the header file but the
34// definiton of the structure in the source file make the mmembers of the
35// structure publicy invisible. That is intended but we will change it with
36// using C++ private. --Ingo
37typedef struct s_UpnpString UpnpString;
38
44PUPNP_Api UpnpString* UpnpString_new(void);
45
49PUPNP_Api void UpnpString_delete(
51 UpnpString* p);
52
58PUPNP_Api UpnpString* UpnpString_dup(
60 const UpnpString* p);
61
65PUPNP_Api void UpnpString_assign(
67 UpnpString* p,
69 const UpnpString* q);
70
76PUPNP_Api size_t UpnpString_get_Length(
78 const UpnpString* p);
79
84PUPNP_Api void UpnpString_set_Length(
86 UpnpString* p,
88 size_t n);
89
96PUPNP_Api const char* UpnpString_get_String(
98 const UpnpString* p);
99
104PUPNP_Api int UpnpString_set_String(
106 UpnpString* p,
108 const char* s);
109
113PUPNP_Api int UpnpString_set_StringN(
115 UpnpString* p,
117 const char* s,
119 size_t n);
120
124PUPNP_Api void UpnpString_clear(
126 UpnpString* p);
127
133PUPNP_Api int UpnpString_cmp(
135 UpnpString* p,
137 UpnpString* q);
138
144PUPNP_Api int UpnpString_casecmp(
146 UpnpString* p,
148 UpnpString* q);
149
150#ifdef __cplusplus
151}
152#endif /* __cplusplus */
153
154
156
157#endif // COMPA_UPNPSTRING_HPP
Internal implementation of the class UpnpString.
PUPNP_Api UpnpString * UpnpString_dup(const UpnpString *p)
Copy Constructor.
PUPNP_Api int UpnpString_set_StringN(UpnpString *p, const char *s, size_t n)
Sets the string from a pointer to char using a maximum of N chars.
PUPNP_Api int UpnpString_set_String(UpnpString *p, const char *s)
Sets the string from a pointer to char.
PUPNP_Api int UpnpString_casecmp(UpnpString *p, UpnpString *q)
Compares two strings for equality. Case does not matter.
PUPNP_Api size_t UpnpString_get_Length(const UpnpString *p)
Returns the length of the string.
PUPNP_Api UpnpString * UpnpString_new(void)
Constructor.
PUPNP_Api const char * UpnpString_get_String(const UpnpString *p)
Returns the pointer to char.
PUPNP_Api void UpnpString_delete(UpnpString *p)
Destructor.
PUPNP_Api int UpnpString_cmp(UpnpString *p, UpnpString *q)
Compares two strings for equality. Case matters.
PUPNP_Api void UpnpString_set_Length(UpnpString *p, size_t n)
Truncates the string to the specified lenght, or does nothing if the current lenght is less than or e...
PUPNP_Api void UpnpString_assign(UpnpString *p, const UpnpString *q)
Assignment operator.
PUPNP_Api void UpnpString_clear(UpnpString *p)
Clears the string, sets its size to zero.
Macros to support visibility of external symbols.