本文整理汇总了C++中yaml::Emitter::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Emitter::size方法的具体用法?C++ Emitter::size怎么用?C++ Emitter::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yaml::Emitter
的用法示例。
在下文中一共展示了Emitter::size方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
std::string cfg::node::to_string() const
{
YAML::Emitter out;
cfg::encode(out, *this);
return {out.c_str(), out.size()};
}
示例2: save_gui_cfg
void save_gui_cfg()
{
YAML::Emitter out;
out.SetSeqFormat(YAML::Flow);
out << g_gui_cfg;
// Save to file
s_gui_cfg.seek(0);
s_gui_cfg.trunc(0);
s_gui_cfg.write(out.c_str(), out.size());
}
示例3: saveSettings
void SettingsHandler::saveSettings()
{
mutex.lock();
YAML::Emitter out;
out << S;
settingsFile->open(QFile::WriteOnly | QFile::Text);
settingsFile->write(out.c_str(), out.size());
settingsFile->close();
mutex.unlock();
}
示例4: closeButtonPressed
void LightingWindow::closeButtonPressed() {
if (runningInTest_) {
quit();
} else if (SocketLineGetter* getter = SocketLineGetter::instance()) {
YAML::Emitter out;
out << YAML::BeginMap
<< YAML::Key << "type"
<< YAML::Value << "hide"
<< YAML::EndMap;
getter->writeSocket(out.c_str(), out.size());
}
}
示例5: moved
void LightingWindow::moved() {
if (initialized_) {
if (SocketLineGetter* getter = SocketLineGetter::instance()) {
YAML::Emitter out;
out << YAML::BeginMap
<< YAML::Key << "type"
<< YAML::Value << "move"
<< YAML::Key << "top_left"
<< YAML::Value << YAML::BeginSeq
<< getX() << getY() - getTitleBarHeight()
<< YAML::EndSeq
<< YAML::EndMap;
getter->writeSocket(out.c_str(), out.size());
}
}
}
示例6: SaveSettings
void emu_settings::SaveSettings()
{
fs::file config;
YAML::Emitter out;
emitData(out, m_currentSettings);
if (!m_title_id.empty())
{
config = fs::file(Emu.GetCustomConfigPath(m_title_id), fs::read + fs::write + fs::create);
}
else
{
config = fs::file(fs::get_config_dir() + "/config.yml", fs::read + fs::write + fs::create);
}
// Save config
config.seek(0);
config.trunc(0);
config.write(out.c_str(), out.size());
config.close();
}
示例7: emitDefaultSettings
void SettingsHandler::emitDefaultSettings()
{
QFileInfo settingsFileInfo(settingsFile->fileName());
settingsFileInfo.absoluteDir().mkpath(QStringLiteral("."));
YAML::Emitter out;
out.SetIndent(4);
out.SetMapFormat(YAML::Flow);
out << YAML::BeginMap
<< YAML::Key << "general"
<< YAML::Value << YAML::BeginMap
<< YAML::Key << "userInfo"
<< YAML::Value << YAML::BeginMap
<< YAML::Key << "userName"
<< YAML::Value << tr("User", "Default user name in settings")
<< YAML::EndMap
<< YAML::EndMap
<< YAML::EndMap;
settingsFile->open(QFile::WriteOnly | QFile::Text);
settingsFile->write(out.c_str(), out.size());
settingsFile->close();
}
示例8: ppu_decoder_modes
//.........这里部分代码省略.........
s_subpanel_core1->Add(chbox_core_load_liblv2, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_core2->Add(s_round_core_lle, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_core->Add(s_subpanel_core1);
s_subpanel_core->Add(s_subpanel_core2);
// Graphics
s_subpanel_graphics1->Add(s_round_gs_render, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics1->Add(s_round_gs_res, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics1->Add(s_round_gs_d3d_adapter, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics1->Add(chbox_gs_dump_color, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics1->Add(chbox_gs_read_color, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics1->Add(chbox_gs_dump_depth, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics1->Add(chbox_gs_read_depth, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics1->Add(chbox_gs_gl_legacy_buffers, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics2->Add(s_round_gs_aspect, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics2->Add(s_round_gs_frame_limit, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics2->AddSpacer(68);
s_subpanel_graphics2->Add(chbox_gs_debug_output, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics2->Add(chbox_gs_overlay, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics2->Add(chbox_gs_log_prog, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics2->Add(chbox_gs_vsync, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_graphics->Add(s_subpanel_graphics1);
s_subpanel_graphics->Add(s_subpanel_graphics2);
// Input - Output
s_subpanel_io1->Add(s_round_io_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_io1->Add(s_round_io_keyboard_handler, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_io1->Add(s_round_io_mouse_handler, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_io2->Add(s_round_io_camera, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_io2->Add(s_round_io_camera_type, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_io->Add(s_subpanel_io1);
s_subpanel_io->Add(s_subpanel_io2);
// Audio
s_subpanel_audio->Add(s_round_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_audio->Add(chbox_audio_dump, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_audio->Add(chbox_audio_conv, wxSizerFlags().Border(wxALL, 5).Expand());
// Miscellaneous
s_subpanel_misc->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_hle_always_start, wxSizerFlags().Border(wxALL, 5).Expand());
// Auto Pause
s_subpanel_misc->Add(chbox_dbg_ap_systemcall, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_dbg_ap_functioncall, wxSizerFlags().Border(wxALL, 5).Expand());
// Networking
s_subpanel_networking->Add(s_round_net_status, wxSizerFlags().Border(wxALL, 5).Expand());
// System
s_subpanel_system->Add(chbox_vfs_enable_host_root, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_system->Add(s_round_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand());
// Buttons
wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL));
s_b_panel->Add(new wxButton(this, wxID_OK), wxSizerFlags().Border(wxALL, 5).Bottom());
s_b_panel->Add(new wxButton(this, wxID_CANCEL), wxSizerFlags().Border(wxALL, 5).Bottom());
// Resize panels
SetSizerAndFit(s_subpanel_core, false);
SetSizerAndFit(s_subpanel_graphics, false);
SetSizerAndFit(s_subpanel_io, false);
SetSizerAndFit(s_subpanel_audio, false);
SetSizerAndFit(s_subpanel_misc, false);
SetSizerAndFit(s_subpanel_networking, false);
SetSizerAndFit(s_subpanel_system, false);
SetSizerAndFit(s_b_panel, false);
SetSize(width + 26, height + 80);
if (ShowModal() == wxID_OK)
{
std::set<std::string> lle_selected;
for (auto& i : lle_module_list)
{
if (i.second) // selected
{
lle_selected.emplace(i.first);
}
}
saved.reset();
saved["Core"]["Load libraries"] = std::vector<std::string>(lle_selected.begin(), lle_selected.end());
for (auto& pad : pads)
{
pad->save();
}
loaded += saved;
YAML::Emitter out;
emit(out, loaded);
// Save config
config.seek(0);
config.trunc(0);
config.write(out.c_str(), out.size());
}
}
示例9: Load
void Emulator::Load(bool add_only)
{
Stop();
try
{
Init();
// Load game list (maps ABCD12345 IDs to /dev_bdvd/ locations)
YAML::Node games = YAML::Load(fs::file{fs::get_config_dir() + "/games.yml", fs::read + fs::create}.to_string());
if (!games.IsMap())
{
games.reset();
}
LOG_NOTICE(LOADER, "Path: %s", m_path);
const std::string elf_dir = fs::get_parent_dir(m_path);
// Load PARAM.SFO (TODO)
const auto _psf = psf::load_object([&]
{
if (fs::file sfov{elf_dir + "/sce_sys/param.sfo"})
{
return sfov;
}
else
{
return fs::file(elf_dir + "/../PARAM.SFO");
}
}());
m_title = psf::get_string(_psf, "TITLE", m_path);
m_title_id = psf::get_string(_psf, "TITLE_ID");
const auto _cat = psf::get_string(_psf, "CATEGORY");
LOG_NOTICE(LOADER, "Title: %s", GetTitle());
LOG_NOTICE(LOADER, "Serial: %s", GetTitleID());
// Initialize data/cache directory
m_cache_path = fs::get_data_dir(m_title_id, m_path);
LOG_NOTICE(LOADER, "Cache: %s", GetCachePath());
// Load custom config-0
if (fs::file cfg_file{m_cache_path + "/config.yml"})
{
LOG_NOTICE(LOADER, "Applying custom config: %s/config.yml", m_cache_path);
g_cfg.from_string(cfg_file.to_string());
}
// Load custom config-1
if (fs::file cfg_file{fs::get_config_dir() + "data/" + m_title_id + "/config.yml"})
{
LOG_NOTICE(LOADER, "Applying custom config: data/%s/config.yml", m_title_id);
g_cfg.from_string(cfg_file.to_string());
}
// Load custom config-2
if (fs::file cfg_file{m_path + ".yml"})
{
LOG_NOTICE(LOADER, "Applying custom config: %s.yml", m_path);
g_cfg.from_string(cfg_file.to_string());
}
LOG_NOTICE(LOADER, "Used configuration:\n%s\n", g_cfg.to_string());
// Load patches from different locations
fxm::check_unlocked<patch_engine>()->append(fs::get_config_dir() + "data/" + m_title_id + "/patch.yml");
fxm::check_unlocked<patch_engine>()->append(m_cache_path + "/patch.yml");
// Mount all devices
const std::string emu_dir_ = g_cfg.vfs.emulator_dir;
const std::string emu_dir = emu_dir_.empty() ? fs::get_config_dir() : emu_dir_;
const std::string home_dir = g_cfg.vfs.app_home;
std::string bdvd_dir = g_cfg.vfs.dev_bdvd;
vfs::mount("dev_hdd0", fmt::replace_all(g_cfg.vfs.dev_hdd0, "$(EmulatorDir)", emu_dir));
vfs::mount("dev_hdd1", fmt::replace_all(g_cfg.vfs.dev_hdd1, "$(EmulatorDir)", emu_dir));
vfs::mount("dev_flash", fmt::replace_all(g_cfg.vfs.dev_flash, "$(EmulatorDir)", emu_dir));
vfs::mount("dev_usb", fmt::replace_all(g_cfg.vfs.dev_usb000, "$(EmulatorDir)", emu_dir));
vfs::mount("dev_usb000", fmt::replace_all(g_cfg.vfs.dev_usb000, "$(EmulatorDir)", emu_dir));
vfs::mount("app_home", home_dir.empty() ? elf_dir + '/' : fmt::replace_all(home_dir, "$(EmulatorDir)", emu_dir));
// Detect boot location
const std::string hdd0_game = vfs::get("/dev_hdd0/game/");
const std::string hdd0_disc = vfs::get("/dev_hdd0/disc/");
if (_cat == "DG" && m_path.find(hdd0_game + m_title_id + '/') != -1)
{
// Booting disc game from wrong location
LOG_ERROR(LOADER, "Disc game found at invalid location: /dev_hdd0/game/%s/", m_title_id);
// Move and retry from correct location
if (fs::rename(hdd0_game + m_title_id, hdd0_disc + m_title_id))
{
LOG_SUCCESS(LOADER, "Disc game moved to special location: /dev_hdd0/disc/%s/", m_title_id);
return SetPath(hdd0_disc + m_path.substr(hdd0_game.size())), Load();
}
else
{
//.........这里部分代码省略.........
示例10: size
size_t size()
{
return emitter.size();
}