Merge branch 'release-3.29'
[kiteware-cmake.git] / Source / cmListFileLexer.h
blob3c89f63416a3c1a3bd68ffd2d9ee26315738e6de
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
9 /* NOLINTNEXTLINE(modernize-use-using) */
10 typedef enum cmListFileLexer_Type_e
12 cmListFileLexer_Token_None,
13 cmListFileLexer_Token_Space,
14 cmListFileLexer_Token_Newline,
15 cmListFileLexer_Token_Identifier,
16 cmListFileLexer_Token_ParenLeft,
17 cmListFileLexer_Token_ParenRight,
18 cmListFileLexer_Token_ArgumentUnquoted,
19 cmListFileLexer_Token_ArgumentQuoted,
20 cmListFileLexer_Token_ArgumentBracket,
21 cmListFileLexer_Token_CommentBracket,
22 cmListFileLexer_Token_BadCharacter,
23 cmListFileLexer_Token_BadBracket,
24 cmListFileLexer_Token_BadString
25 } cmListFileLexer_Type;
27 /* NOLINTNEXTLINE(modernize-use-using) */
28 typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
29 struct cmListFileLexer_Token_s
31 cmListFileLexer_Type type;
32 char* text;
33 int length;
34 int line;
35 int column;
38 enum cmListFileLexer_BOM_e
40 cmListFileLexer_BOM_None,
41 cmListFileLexer_BOM_Broken,
42 cmListFileLexer_BOM_UTF8,
43 cmListFileLexer_BOM_UTF16BE,
44 cmListFileLexer_BOM_UTF16LE,
45 cmListFileLexer_BOM_UTF32BE,
46 cmListFileLexer_BOM_UTF32LE
49 /* NOLINTNEXTLINE(modernize-use-using) */
50 typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM;
52 /* NOLINTNEXTLINE(modernize-use-using) */
53 typedef struct cmListFileLexer_s cmListFileLexer;
55 cmListFileLexer* cmListFileLexer_New(void);
56 int cmListFileLexer_SetFileName(cmListFileLexer*, const char*,
57 cmListFileLexer_BOM* bom);
58 int cmListFileLexer_SetString(cmListFileLexer*, const char*);
59 cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
60 long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
61 long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
62 const char* cmListFileLexer_GetTypeAsString(cmListFileLexer*,
63 cmListFileLexer_Type);
64 void cmListFileLexer_Delete(cmListFileLexer*);
66 #ifdef __cplusplus
67 } /* extern "C" */
68 #endif