MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ read_text_file()

std::string MayaFlux::Core::VKShaderModule::read_text_file ( const std::string &  filepath)
staticprivate

Read text file into string.

Parameters
filepathPath to file
Returns
File contents, or empty string on failure

Definition at line 594 of file VKShaderModule.cpp.

595{
596 std::ifstream file(filepath);
597 if (!file.is_open()) {
599 "Failed to open file: '{}'", filepath);
600 return {};
601 }
602
603 std::string content(
604 (std::istreambuf_iterator<char>(file)),
605 std::istreambuf_iterator<char>());
606
607 if (content.empty()) {
609 "File is empty: '{}'", filepath);
610 }
611
612 return content;
613}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::GraphicsBackend, MF_ERROR, and MF_WARN.

Referenced by create_from_glsl_file().

+ Here is the caller graph for this function: