#include "benchmark/benchmark.h"
#include <regex>
#include <iostream>
Go to the source code of this file.
|
enum | Keyword {
KEYWORD_ADD_ANIMATION = 1,
KEYWORD_AIRBRAKES,
KEYWORD_ANIMATORS,
KEYWORD_ANTI_LOCK_BRAKES,
KEYWORD_AXLES,
KEYWORD_AUTHOR,
KEYWORD_BACKMESH,
KEYWORD_BEAMS,
KEYWORD_BRAKES,
KEYWORD_CAB,
KEYWORD_CAMERARAIL,
KEYWORD_CAMERAS,
KEYWORD_CINECAM,
KEYWORD_COLLISIONBOXES,
KEYWORD_COMMANDS,
KEYWORD_COMMANDS2,
KEYWORD_CONTACTERS,
KEYWORD_CRUISECONTROL,
KEYWORD_DESCRIPTION,
KEYWORD_DETACHER_GROUP,
KEYWORD_DISABLEDEFAULTSOUNDS,
KEYWORD_ENABLE_ADVANCED_DEFORMATION,
KEYWORD_END,
KEYWORD_END_SECTION,
KEYWORD_ENGINE,
KEYWORD_ENGOPTION,
KEYWORD_ENGTURBO,
KEYWORD_ENVMAP,
KEYWORD_EXHAUSTS,
KEYWORD_EXTCAMERA,
KEYWORD_FILEFORMATVERSION,
KEYWORD_FILEINFO,
KEYWORD_FIXES,
KEYWORD_FLARES,
KEYWORD_FLARES2,
KEYWORD_FLEXBODIES,
KEYWORD_FLEXBODY_CAMERA_MODE,
KEYWORD_FLEXBODYWHEELS,
KEYWORD_FORWARDCOMMANDS,
KEYWORD_FUSEDRAG,
KEYWORD_GLOBALS,
KEYWORD_GUID,
KEYWORD_GUISETTINGS,
KEYWORD_HELP,
KEYWORD_HIDE_IN_CHOOSER,
KEYWORD_HOOKGROUP,
KEYWORD_HOOKS,
KEYWORD_HYDROS,
KEYWORD_IMPORTCOMMANDS,
KEYWORD_LOCKGROUPS,
KEYWORD_LOCKGROUP_DEFAULT_NOLOCK,
KEYWORD_MANAGEDMATERIALS,
KEYWORD_MATERIALFLAREBINDINGS,
KEYWORD_MESHWHEELS,
KEYWORD_MESHWHEELS2,
KEYWORD_MINIMASS,
KEYWORD_NODECOLLISION,
KEYWORD_NODES,
KEYWORD_NODES2,
KEYWORD_PARTICLES,
KEYWORD_PISTONPROPS,
KEYWORD_PROP_CAMERA_MODE,
KEYWORD_PROPS,
KEYWORD_RAILGROUPS,
KEYWORD_RESCUER,
KEYWORD_RIGIDIFIERS,
KEYWORD_ROLLON,
KEYWORD_ROPABLES,
KEYWORD_ROPES,
KEYWORD_ROTATORS,
KEYWORD_ROTATORS2,
KEYWORD_SCREWPROPS,
KEYWORD_SECTION,
KEYWORD_SECTIONCONFIG,
KEYWORD_SET_BEAM_DEFAULTS,
KEYWORD_SET_BEAM_DEFAULTS_SCALE,
KEYWORD_SET_COLLISION_RANGE,
KEYWORD_SET_INERTIA_DEFAULTS,
KEYWORD_SET_MANAGEDMATERIALS_OPTIONS,
KEYWORD_SET_NODE_DEFAULTS,
KEYWORD_SET_SHADOWS,
KEYWORD_SET_SKELETON_SETTINGS,
KEYWORD_SHOCKS,
KEYWORD_SHOCKS2,
KEYWORD_SLIDENODE_CONNECT_INSTANTLY,
KEYWORD_SLIDENODES,
KEYWORD_SLOPE_BRAKE,
KEYWORD_SOUNDSOURCES,
KEYWORD_SOUNDSOURCES2,
KEYWORD_SPEEDLIMITER,
KEYWORD_SUBMESH,
KEYWORD_SUBMESH_GROUNDMODEL,
KEYWORD_TEXCOORDS,
KEYWORD_TIES,
KEYWORD_TORQUECURVE,
KEYWORD_TRACTION_CONTROL,
KEYWORD_TRIGGERS,
KEYWORD_TURBOJETS,
KEYWORD_TURBOPROPS,
KEYWORD_TURBOPROPS2,
KEYWORD_VIDEOCAMERA,
KEYWORD_WHEELDETACHERS,
KEYWORD_WHEELS,
KEYWORD_WHEELS2,
KEYWORD_WINGS,
KEYWORD_INVALID = 0xFFFFFFFF
} |
|
◆ CASE
#define CASE |
( |
|
_LOWER_ | ) |
case(_LOWER_): case((_LOWER_)-32) |
◆ DEFINE_REGEX_IGNORECASE
#define DEFINE_REGEX_IGNORECASE |
( |
|
_NAME_, |
|
|
|
_REGEXP_ |
|
) |
| const std::regex _NAME_ = std::regex( _REGEXP_, std::regex::ECMAScript | std::regex::icase); |
◆ E_DELIMITER_SPACE
#define E_DELIMITER_SPACE "[[:blank:]]+" |
◆ E_KEYWORD_BLOCK
#define E_KEYWORD_BLOCK |
( |
|
_NAME_ | ) |
"(^" _NAME_ "[[:blank:]]*$)?" |
◆ E_KEYWORD_INLINE
◆ E_KEYWORD_INLINE_TOLERANT
#define E_KEYWORD_INLINE_TOLERANT |
( |
|
_NAME_ | ) |
"(^" _NAME_ "[[:blank:],]+" ".*$)?" |
◆ IDENTIFY_KEYWORD_REGEX_STRING
#define IDENTIFY_KEYWORD_REGEX_STRING |
◆ MATCH
#define MATCH |
( |
|
_STR_, |
|
|
|
_KWORD_ |
|
) |
| if (stricmp(line+1, _STR_+1) == 0) return _KWORD_; |
◆ stricmp
#define stricmp strcasecmp |
◆ strnicmp
#define strnicmp strncasecmp |
◆ Keyword
Enumerator |
---|
KEYWORD_ADD_ANIMATION | |
KEYWORD_AIRBRAKES | |
KEYWORD_ANIMATORS | |
KEYWORD_ANTI_LOCK_BRAKES | |
KEYWORD_AXLES | |
KEYWORD_AUTHOR | |
KEYWORD_BACKMESH | |
KEYWORD_BEAMS | |
KEYWORD_BRAKES | |
KEYWORD_CAB | |
KEYWORD_CAMERARAIL | |
KEYWORD_CAMERAS | |
KEYWORD_CINECAM | |
KEYWORD_COLLISIONBOXES | |
KEYWORD_COMMANDS | |
KEYWORD_COMMANDS2 | |
KEYWORD_CONTACTERS | |
KEYWORD_CRUISECONTROL | |
KEYWORD_DESCRIPTION | |
KEYWORD_DETACHER_GROUP | |
KEYWORD_DISABLEDEFAULTSOUNDS | |
KEYWORD_ENABLE_ADVANCED_DEFORMATION | |
KEYWORD_END | |
KEYWORD_END_SECTION | |
KEYWORD_ENGINE | |
KEYWORD_ENGOPTION | |
KEYWORD_ENGTURBO | |
KEYWORD_ENVMAP | |
KEYWORD_EXHAUSTS | |
KEYWORD_EXTCAMERA | |
KEYWORD_FILEFORMATVERSION | |
KEYWORD_FILEINFO | |
KEYWORD_FIXES | |
KEYWORD_FLARES | |
KEYWORD_FLARES2 | |
KEYWORD_FLEXBODIES | |
KEYWORD_FLEXBODY_CAMERA_MODE | |
KEYWORD_FLEXBODYWHEELS | |
KEYWORD_FORWARDCOMMANDS | |
KEYWORD_FUSEDRAG | |
KEYWORD_GLOBALS | |
KEYWORD_GUID | |
KEYWORD_GUISETTINGS | |
KEYWORD_HELP | |
KEYWORD_HIDE_IN_CHOOSER | |
KEYWORD_HOOKGROUP | |
KEYWORD_HOOKS | |
KEYWORD_HYDROS | |
KEYWORD_IMPORTCOMMANDS | |
KEYWORD_LOCKGROUPS | |
KEYWORD_LOCKGROUP_DEFAULT_NOLOCK | |
KEYWORD_MANAGEDMATERIALS | |
KEYWORD_MATERIALFLAREBINDINGS | |
KEYWORD_MESHWHEELS | |
KEYWORD_MESHWHEELS2 | |
KEYWORD_MINIMASS | |
KEYWORD_NODECOLLISION | |
KEYWORD_NODES | |
KEYWORD_NODES2 | |
KEYWORD_PARTICLES | |
KEYWORD_PISTONPROPS | |
KEYWORD_PROP_CAMERA_MODE | |
KEYWORD_PROPS | |
KEYWORD_RAILGROUPS | |
KEYWORD_RESCUER | |
KEYWORD_RIGIDIFIERS | |
KEYWORD_ROLLON | |
KEYWORD_ROPABLES | |
KEYWORD_ROPES | |
KEYWORD_ROTATORS | |
KEYWORD_ROTATORS2 | |
KEYWORD_SCREWPROPS | |
KEYWORD_SECTION | |
KEYWORD_SECTIONCONFIG | |
KEYWORD_SET_BEAM_DEFAULTS | |
KEYWORD_SET_BEAM_DEFAULTS_SCALE | |
KEYWORD_SET_COLLISION_RANGE | |
KEYWORD_SET_INERTIA_DEFAULTS | |
KEYWORD_SET_MANAGEDMATERIALS_OPTIONS | |
KEYWORD_SET_NODE_DEFAULTS | |
KEYWORD_SET_SHADOWS | |
KEYWORD_SET_SKELETON_SETTINGS | |
KEYWORD_SHOCKS | |
KEYWORD_SHOCKS2 | |
KEYWORD_SLIDENODE_CONNECT_INSTANTLY | |
KEYWORD_SLIDENODES | |
KEYWORD_SLOPE_BRAKE | |
KEYWORD_SOUNDSOURCES | |
KEYWORD_SOUNDSOURCES2 | |
KEYWORD_SPEEDLIMITER | |
KEYWORD_SUBMESH | |
KEYWORD_SUBMESH_GROUNDMODEL | |
KEYWORD_TEXCOORDS | |
KEYWORD_TIES | |
KEYWORD_TORQUECURVE | |
KEYWORD_TRACTION_CONTROL | |
KEYWORD_TRIGGERS | |
KEYWORD_TURBOJETS | |
KEYWORD_TURBOPROPS | |
KEYWORD_TURBOPROPS2 | |
KEYWORD_VIDEOCAMERA | |
KEYWORD_WHEELDETACHERS | |
KEYWORD_WHEELS | |
KEYWORD_WHEELS2 | |
KEYWORD_WINGS | |
KEYWORD_INVALID | |
Definition at line 6 of file Bench_TruckParser_IdentifyKeyword.cpp.
◆ Bench_sol1__Regex()
static void Bench_sol1__Regex |
( |
benchmark::State & |
state | ) |
|
|
static |
◆ Bench_sol1b_RegexPreCond()
static void Bench_sol1b_RegexPreCond |
( |
benchmark::State & |
state | ) |
|
|
static |
◆ Bench_sol1c_RegexPreCondIsdigit()
static void Bench_sol1c_RegexPreCondIsdigit |
( |
benchmark::State & |
state | ) |
|
|
static |
◆ Bench_sol1d_RegexPreCondIsAlpha()
static void Bench_sol1d_RegexPreCondIsAlpha |
( |
benchmark::State & |
state | ) |
|
|
static |
◆ Bench_sol2__Switch()
static void Bench_sol2__Switch |
( |
benchmark::State & |
state | ) |
|
|
static |
◆ Bench_sol2b_SwitchPreCond()
static void Bench_sol2b_SwitchPreCond |
( |
benchmark::State & |
state | ) |
|
|
static |
◆ BENCHMARK() [1/6]
◆ BENCHMARK() [2/6]
◆ BENCHMARK() [3/6]
◆ BENCHMARK() [4/6]
◆ BENCHMARK() [5/6]
◆ BENCHMARK() [6/6]
◆ FindKeywordMatch()
unsigned FindKeywordMatch |
( |
std::smatch & |
search_results | ) |
|
◆ IdentifyKeywordSwitch()
Keyword IdentifyKeywordSwitch |
( |
const char * |
line | ) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ PrepareBench_sol1()
void PrepareBench_sol1 |
( |
| ) |
|
◆ keyword
◆ lines_vec
std::vector<std::string> lines_vec |
◆ trucklines