Cogs.Core
Source
Utilities
Preprocessor.h
1
#pragma once
2
#include "Strings.h"
3
4
#include "Foundation/StringView.h"
5
6
#include <string>
7
#include <functional>
8
#include <unordered_set>
9
#include <unordered_map>
10
11
template
<>
12
struct
std::hash<
Cogs
::Core::StringRef>
13
{
14
std::hash<uint32_t> hasher;
15
size_t
operator()(
const
Cogs::Core::StringRef
& ref)
const
16
{
17
return
hasher(ref.value);
18
}
19
};
20
21
namespace
Cogs::Core
22
{
23
class
Context;
24
25
41
struct
COGSCORE_DLL_API
PartialPreprocessor
42
{
48
std::string
processed
;
49
51
std::unordered_set<StringRef>
identifiersSeen
;
52
54
std::unordered_map<StringRef, StringRef>
definitions
;
55
63
[[nodiscard]]
bool
process(
Context
* context,
const
StringView
input);
64
};
65
}
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::StringView
Provides a weakly referenced view over the contents of a string.
Definition:
StringView.h:24
Cogs::Core
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Definition:
ComponentFunctions.h:10
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::Core::PartialPreprocessor
Partial C preprocessor.
Definition:
Preprocessor.h:42
Cogs::Core::PartialPreprocessor::definitions
std::unordered_map< StringRef, StringRef > definitions
Set of preprocessor defines encountered in active text.
Definition:
Preprocessor.h:54
Cogs::Core::PartialPreprocessor::identifiersSeen
std::unordered_set< StringRef > identifiersSeen
Set of identifiers encountered in active text.
Definition:
Preprocessor.h:51
Cogs::Core::PartialPreprocessor::processed
std::string processed
Resulting processed text.
Definition:
Preprocessor.h:48
Cogs::Core::StringRef
Definition:
Strings.h:8
Generated by
1.9.6