clang  14.0.0git
CXString.h
Go to the documentation of this file.
1 /*===-- clang-c/CXString.h - C Index strings --------------------*- C -*-===*\
2 |* *|
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4 |* Exceptions. *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This header provides the interface to C Index strings. *|
11 |* *|
12 \*===----------------------------------------------------------------------===*/
13 
14 #ifndef LLVM_CLANG_C_CXSTRING_H
15 #define LLVM_CLANG_C_CXSTRING_H
16 
17 #include "clang-c/ExternC.h"
18 #include "clang-c/Platform.h"
19 
21 
22 /**
23  * \defgroup CINDEX_STRING String manipulation routines
24  * \ingroup CINDEX
25  *
26  * @{
27  */
28 
29 /**
30  * A character string.
31  *
32  * The \c CXString type is used to return strings from the interface when
33  * the ownership of that string might differ from one call to the next.
34  * Use \c clang_getCString() to retrieve the string data and, once finished
35  * with the string data, call \c clang_disposeString() to free the string.
36  */
37 typedef struct {
38  const void *data;
39  unsigned private_flags;
40 } CXString;
41 
42 typedef struct {
44  unsigned Count;
45 } CXStringSet;
46 
47 /**
48  * Retrieve the character data associated with the given string.
49  */
50 CINDEX_LINKAGE const char *clang_getCString(CXString string);
51 
52 /**
53  * Free the given string.
54  */
56 
57 /**
58  * Free the given string set.
59  */
61 
62 /**
63  * @}
64  */
65 
67 
68 #endif
69 
LLVM_CLANG_C_EXTERN_C_END
#define LLVM_CLANG_C_EXTERN_C_END
Definition: ExternC.h:36
CXStringSet::Count
unsigned Count
Definition: CXString.h:44
clang_disposeString
CINDEX_LINKAGE void clang_disposeString(CXString string)
Free the given string.
CXStringSet
Definition: CXString.h:42
LLVM_CLANG_C_EXTERN_C_BEGIN
#define LLVM_CLANG_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
clang_getCString
const CINDEX_LINKAGE char * clang_getCString(CXString string)
Retrieve the character data associated with the given string.
Platform.h
clang_disposeStringSet
CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set)
Free the given string set.
CXString::private_flags
unsigned private_flags
Definition: CXString.h:39
set
set(LLVM_LINK_COMPONENTS Support) set(LLVM_EXPORTED_SYMBOL_FILE $
Definition: CMakeLists.txt:1
CXString::data
const void * data
Definition: CXString.h:38
CINDEX_LINKAGE
#define CINDEX_LINKAGE
Definition: Platform.h:38
CXString
A character string.
Definition: CXString.h:37
CXStringSet::Strings
CXString * Strings
Definition: CXString.h:43
ExternC.h