OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::PresetCollection::PresetFilesOnDisk Struct Reference

Public Member Functions

bool operator== (const PresetFilesOnDisk &rhs) const

Static Public Member Functions

static PresetFilesOnDisk read (const boost::filesystem::path &file)

Public Attributes

std::optional< std::string > json
std::optional< std::string > info

Detailed Description

Member Function Documentation

◆ operator==()

bool Slic3r::PresetCollection::PresetFilesOnDisk::operator== ( const PresetFilesOnDisk & rhs) const
inline
967{ return json == rhs.json && info == rhs.info; }
std::optional< std::string > json
Definition Preset.hpp:963
std::optional< std::string > info
Definition Preset.hpp:964

References info, and json.

◆ read()

PresetCollection::PresetFilesOnDisk Slic3r::PresetCollection::PresetFilesOnDisk::read ( const boost::filesystem::path & file)
static
1810{
1811 auto read_if_present = [](const fs::path &path) -> std::optional<std::string> {
1812 std::string bytes;
1813 try {
1814 load_string_file(path, bytes);
1815 } catch (const std::exception &) {
1816 return std::nullopt;
1817 }
1818 return bytes;
1819 };
1820 fs::path info_path(file);
1821 info_path.replace_extension(".info");
1822 return { read_if_present(file), read_if_present(info_path) };
1823}
void load_string_file(const boost::filesystem::path &p, std::string &str)
Definition utils.cpp:2164

References Slic3r::load_string_file().

Referenced by Slic3r::PresetCollection::resolve_user_preset().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ info

std::optional<std::string> Slic3r::PresetCollection::PresetFilesOnDisk::info

Referenced by operator==().

◆ json

std::optional<std::string> Slic3r::PresetCollection::PresetFilesOnDisk::json

Referenced by operator==().


The documentation for this struct was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Preset.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Preset.cpp