Lines 5-12
Link Here
|
5 |
#include "libslic3r/PresetBundle.hpp" |
5 |
#include "libslic3r/PresetBundle.hpp" |
6 |
#include "libslic3r/Print.hpp" |
6 |
#include "libslic3r/Print.hpp" |
7 |
|
7 |
|
|
|
8 |
#include <fstream> |
8 |
#include <string> |
9 |
#include <string> |
9 |
|
10 |
|
|
|
11 |
#include <boost/filesystem.hpp> |
12 |
|
10 |
#include <angelscript/source/as_config.h> |
13 |
#include <angelscript/source/as_config.h> |
11 |
#include <angelscript/add_on/autowrapper/aswrappedcall.h> |
14 |
#include <angelscript/add_on/autowrapper/aswrappedcall.h> |
12 |
#include <angelscript/add_on/scriptarray/scriptarray.h> |
15 |
#include <angelscript/add_on/scriptarray/scriptarray.h> |
Lines 616-621
bool as_is_enabled(std::string &key)
Link Here
|
616 |
return f->is_enabled(); |
619 |
return f->is_enabled(); |
617 |
} |
620 |
} |
618 |
|
621 |
|
|
|
622 |
inline |
623 |
void load_string_file(const boost::filesystem::path& p, std::string& str) |
624 |
{ |
625 |
std::ifstream file; |
626 |
file.exceptions(std::ifstream::failbit | std::ifstream::badbit); |
627 |
file.open(p, std::ios_base::binary); |
628 |
std::size_t sz = static_cast<std::size_t>(boost::filesystem::file_size(p)); |
629 |
str.resize(sz, '\0'); |
630 |
file.read(&str[0], sz); |
631 |
} |
632 |
|
619 |
//function to reset a field |
633 |
//function to reset a field |
620 |
void as_back_initial_value(std::string& key) { |
634 |
void as_back_initial_value(std::string& key) { |
621 |
current_script->add_to_reset(key); |
635 |
current_script->add_to_reset(key); |
Lines 745-751
void ScriptContainer::init(const std::string& tab_key, Tab* tab)
Link Here
|
745 |
//res = builder.AddSectionFromFile(ui_script_file.string().c_str()); //seems to be problematic on cyrillic locale |
759 |
//res = builder.AddSectionFromFile(ui_script_file.string().c_str()); //seems to be problematic on cyrillic locale |
746 |
{ |
760 |
{ |
747 |
std::string all_file; |
761 |
std::string all_file; |
748 |
boost::filesystem::load_string_file(ui_script_file, all_file); |
762 |
load_string_file(ui_script_file, all_file); |
749 |
res = builder.AddSectionFromMemory(ui_script_file.string().c_str(), all_file.c_str(), (unsigned int)(all_file.length()), 0); |
763 |
res = builder.AddSectionFromMemory(ui_script_file.string().c_str(), all_file.c_str(), (unsigned int)(all_file.length()), 0); |
750 |
} |
764 |
} |
751 |
if (res < 0) throw CompileErrorException("Error, can't build the script for tab " + tab_key); |
765 |
if (res < 0) throw CompileErrorException("Error, can't build the script for tab " + tab_key); |