OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::VersionInfo Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/GUI_App.hpp>

Collaboration diagram for Slic3r::GUI::VersionInfo:

Public Member Functions

 VersionInfo ()
void parse_version_str (std::string str)
int compare (std::string ver_str)

Static Public Member Functions

static std::string convert_full_version (std::string short_version)
static std::string convert_short_version (std::string full_version)
static std::string get_full_version ()

Public Attributes

std::string version_str
std::string version_name
std::string description
std::string url
bool force_upgrade { false }
int ver_items [VERSION_LEN]

Detailed Description

Constructor & Destructor Documentation

◆ VersionInfo()

Slic3r::GUI::VersionInfo::VersionInfo ( )
inline
195 {
196 for (int i = 0; i < VERSION_LEN; i++) {
197 ver_items[i] = 0;
198 }
199 force_upgrade = false;
200 version_str = "";
201 }
#define VERSION_LEN
Definition GUI_App.hpp:185
bool force_upgrade
Definition GUI_App.hpp:193
std::string version_str
Definition GUI_App.hpp:189
int ver_items[VERSION_LEN]
Definition GUI_App.hpp:194

References force_upgrade, ver_items, VERSION_LEN, and version_str.

Member Function Documentation

◆ compare()

int Slic3r::GUI::VersionInfo::compare ( std::string ver_str)
inline
225 {
226 if (version_str.empty()) return -1;
227
228 int ver_target[VERSION_LEN];
229 std::vector<std::string> items;
230 boost::split(items, ver_str, boost::is_any_of("."));
231 if (items.size() == VERSION_LEN) {
232 try {
233 for (int i = 0; i < VERSION_LEN; i++) {
234 ver_target[i] = stoi(items[i]);
235 if (ver_target[i] < ver_items[i]) {
236 return 1;
237 }
238 else if (ver_target[i] == ver_items[i]) {
239 continue;
240 }
241 else {
242 return -1;
243 }
244 }
245 }
246 catch (...) {
247 return -1;
248 }
249 }
250 return -1;
251 }

References ver_items, VERSION_LEN, and version_str.

◆ convert_full_version()

std::string Slic3r::GUI::VersionInfo::convert_full_version ( std::string short_version)
static
397{
398 std::string result = "";
399 std::vector<std::string> items;
400 boost::split(items, short_version, boost::is_any_of("."));
401 if (items.size() == VERSION_LEN) {
402 for (int i = 0; i < VERSION_LEN; i++) {
403 std::stringstream ss;
404 ss << std::setw(2) << std::setfill('0') << items[i];
405 result += ss.str();
406 if (i != VERSION_LEN - 1)
407 result += ".";
408 }
409 return result;
410 }
411 return result;
412}

References VERSION_LEN.

Referenced by Slic3r::GUI::GUI_App::check_new_version(), Slic3r::GUI::GUI_App::get_bbl_client_version(), and get_full_version().

Here is the caller graph for this function:

◆ convert_short_version()

std::string Slic3r::GUI::VersionInfo::convert_short_version ( std::string full_version)
static
415{
416 full_version.erase(std::remove(full_version.begin(), full_version.end(), '0'), full_version.end());
417 return full_version;
418}

◆ get_full_version()

std::string Slic3r::GUI::VersionInfo::get_full_version ( )
inlinestatic
220 {
221 return convert_full_version(SLIC3R_VERSION);
222 }
static std::string convert_full_version(std::string short_version)
Definition GUI_App.cpp:396

References convert_full_version().

Here is the call graph for this function:

◆ parse_version_str()

void Slic3r::GUI::VersionInfo::parse_version_str ( std::string str)
inline
203 {
204 version_str = str;
205 std::vector<std::string> items;
206 boost::split(items, str, boost::is_any_of("."));
207 if (items.size() == VERSION_LEN) {
208 try {
209 for (int i = 0; i < VERSION_LEN; i++) {
210 ver_items[i] = stoi(items[i]);
211 }
212 }
213 catch (...) {
214 ;
215 }
216 }
217 }

References ver_items, VERSION_LEN, and version_str.

Member Data Documentation

◆ description

std::string Slic3r::GUI::VersionInfo::description

◆ force_upgrade

bool Slic3r::GUI::VersionInfo::force_upgrade { false }
193{ false };

Referenced by VersionInfo().

◆ url

std::string Slic3r::GUI::VersionInfo::url

◆ ver_items

int Slic3r::GUI::VersionInfo::ver_items[VERSION_LEN]

◆ version_name

std::string Slic3r::GUI::VersionInfo::version_name

◆ version_str

std::string Slic3r::GUI::VersionInfo::version_str

The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/GUI_App.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/GUI_App.cpp