UFO: Alien Invasion
Loading...
Searching...
No Matches
parse.h
Go to the documentation of this file.
1
5
6/*
7All original material Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9Copyright (C) 1997-2001 Id Software, Inc.
10
11This program is free software; you can redistribute it and/or
12modify it under the terms of the GNU General Public License
13as published by the Free Software Foundation; either version 2
14of the License, or (at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20See the GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26*/
27
28#pragma once
29
30#include "ufotypes.h"
31#include "cxx.h"
32
45
46const char* Com_GetToken(const char** data_p);
47Com_TokenType_t Com_GetType(const char** data_p);
48Com_TokenType_t Com_NextToken(const char** data_p);
49
50const char* Com_Parse(const char** data_p, char* target = nullptr, size_t size = 0, bool replaceWhitespaces = true);
51int Com_CountTokensInBuffer(const char* buffer);
52void Com_UnParseLastToken(void);
53void Com_SkipBlock(const char** text);
54int Com_GetBlock(const char** text, const char** start);
voidpf void uLong size
Definition ioapi.h:42
void Com_SkipBlock(const char **text)
Skips a block of {} in our script files.
Definition parse.cpp:253
const char * Com_Parse(const char **data_p, char *target=nullptr, size_t size=0, bool replaceWhitespaces=true)
const char * Com_GetToken(const char **data_p)
Get the current token value.
Definition parse.cpp:51
Com_TokenType_t
Definition parse.h:33
@ TT_BEGIN_BLOCK
Definition parse.h:35
@ TT_END_BLOCK
Definition parse.h:36
@ TT_QUOTED_WORD
Definition parse.h:43
@ TT_WORD
Definition parse.h:42
@ TT_END_LIST
Definition parse.h:39
@ TT_BEGIN_LIST
Definition parse.h:38
@ TT_CONTENT
Definition parse.h:41
@ TT_EOF
Definition parse.h:34
@ TT_COMMA
Definition parse.h:37
int Com_CountTokensInBuffer(const char *buffer)
Counts the tokens in the given buffer that the Com_Parse function would extract.
Definition parse.cpp:80
void Com_UnParseLastToken(void)
Put back the last token into the parser The next call of Com_Parse will return the same token again.
Definition parse.cpp:42
int Com_GetBlock(const char **text, const char **start)
Get the start and end point of a block in the given text.
Definition parse.cpp:272
Com_TokenType_t Com_NextToken(const char **data_p)
Compute the next token.
Definition parse.cpp:69
Com_TokenType_t Com_GetType(const char **data_p)
Get the current token type.
Definition parse.cpp:60
Cross-platform type definitions.