mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 07:07:42 +00:00
Use UTF-8 exclusively internally
This removes SystemString, SystemChar, etc. All filepaths and log strings are assumed to be UTF-8, with conversions to UTF-16 for Windows APIs as appropriate. Updates amuse, athena, boo, kabufua and nod
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#pragma once
|
||||
#include "hecl/SystemChar.hpp"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
@@ -9,9 +8,9 @@ namespace hecl::shaderc {
|
||||
class Compiler {
|
||||
enum class StageType { Vertex, Fragment, Geometry, Control, Evaluation };
|
||||
|
||||
std::vector<SystemString> m_inputFiles;
|
||||
std::unordered_map<SystemString, std::string> m_fileContents;
|
||||
const std::string* getFileContents(SystemStringView path);
|
||||
std::vector<std::string> m_inputFiles;
|
||||
std::unordered_map<std::string, std::string> m_fileContents;
|
||||
const std::string* getFileContents(std::string_view path);
|
||||
std::unordered_map<std::string, std::string> m_defines;
|
||||
template <typename Action, typename P>
|
||||
static bool StageAction(StageType type, const std::string& name, const std::string& basename,
|
||||
@@ -19,12 +18,12 @@ class Compiler {
|
||||
template <typename Action>
|
||||
static bool StageAction(const std::string& platforms, StageType type, const std::string& name,
|
||||
const std::string& basename, const std::string& stage, std::stringstream& implOut);
|
||||
bool includeFile(SystemStringView file, std::string& out, int depth = 0);
|
||||
bool compileFile(SystemStringView file, std::string_view baseName,
|
||||
bool includeFile(std::string_view file, std::string& out, int depth = 0);
|
||||
bool compileFile(std::string_view file, std::string_view baseName,
|
||||
std::pair<std::stringstream, std::stringstream>& out);
|
||||
|
||||
public:
|
||||
void addInputFile(SystemStringView file);
|
||||
void addInputFile(std::string_view file);
|
||||
void addDefine(std::string_view var, std::string_view val);
|
||||
bool compile(std::string_view baseName, std::pair<std::stringstream, std::stringstream>& out);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user