MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / IsHexStream

Function IsHexStream

tools/io.cpp:101–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99bool IsSpace(char c) { return isspace(c) || c == ',' || c == '\0'; }
100
101bool IsHexStream(const std::vector<char>& stream) {
102 for (char c : stream) {
103 if (IsSpace(c)) {
104 continue;
105 }
106
107 // Every possible case of a SPIR-V hex stream starts with either '0' or 'x'
108 // (see |HexMode| values). Make a decision upon inspecting the first
109 // non-space character.
110 return c == '0' || c == 'x' || c == 'X';
111 }
112
113 return false;
114}
115
116bool MatchIgnoreCase(const char* token, const char* expect, size_t len) {
117 for (size_t i = 0; i < len; ++i) {

Callers 1

ReadBinaryFileFunction · 0.85

Calls 1

IsSpaceFunction · 0.85

Tested by

no test coverage detected