本文整理汇总了C++中wxString::ToStdString方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::ToStdString方法的具体用法?C++ wxString::ToStdString怎么用?C++ wxString::ToStdString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::ToStdString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initSchema
CSQLiteAddressbook::CSQLiteAddressbook(CGUID id,
const wxString& strName,
const wxString& strDBFile)
: m_id(id)
, m_is_ok(false)
, m_nSortOrder(C_SORT_SN)
, m_bSortAsc(true)
, m_conn_pool(connection_pool_size)
, m_strName(strName)
, m_strPath(strDBFile)
, m_bMarkedForDeletion(false)
{
try
{
for (int i = 0; i < connection_pool_size; ++i) {
soci::session& session = m_conn_pool.at(i);
session.open(soci::sqlite3, strDBFile.ToStdString());
session << "PRAGMA foreign_keys = ON";
}
initSchema();
}
catch (const soci_error& e) {
m_strLastError = e.what();
}
catch (const std::exception& e) {
m_strLastError = e.what();
}
}
示例2: string
std::string stf::wx2std(const wxString& wxs) {
#if (wxCHECK_VERSION(2, 9, 0) || defined(MODULE_ONLY))
return wxs.ToStdString();
#else
return std::string(wxs.mb_str());
#endif
}
示例3: SetValue
void JGridTable::SetValue(const int row, const int col, const wxString & value) {
if (row < GetNumberRows()) {
if (col < table_[row].size()) {
table_[row][col] = value.ToStdString();
}
}
}
示例4: DoSetPrintContinuity
void PrintContinuityEditorView::DoSetPrintContinuity(int which_sheet,
const wxString& number,
const wxString& cont)
{
std::map<int, std::pair<std::string, std::string>> data{ { which_sheet, { number.ToStdString(), cont.ToStdString() } } };
auto cmd = static_cast<CalChartDoc*>(GetDocument())->Create_SetPrintableContinuity(data);
GetDocument()->GetCommandProcessor()->Submit(cmd.release());
}
示例5: clean_dir
void clean_dir(const wxString& dir) {
namespace fs = boost::filesystem;
fs::path path(dir.ToStdString());
fs::directory_iterator end_dir_it;
for (fs::directory_iterator it(path); it != end_dir_it; ++it) {
if (fs::is_directory(it->path())) continue;
fs::remove_all(it->path());
}
}
示例6: hasName
bool GdaJson::hasName(const json_spirit::Object& obj, const wxString& name)
{
std::string std_name(name.ToStdString());
for (json_spirit::Object::const_iterator i=obj.begin(); i!=obj.end(); ++i)
{
if (i->name_ == std_name) return true;
}
return false;
}
示例7: runtime_error
TileMapImporter::TileMapImporter(const wxString &filePath)
: m_filePath(filePath),
m_map(new Tmx::Map())
{
m_map->ParseFile(filePath.ToStdString());
if(m_map->HasError())
{
throw std::runtime_error("Error when loading the .tmx file");
}
}
示例8: wxBitmapButton
ValueCurveButton::ValueCurveButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name) : wxBitmapButton(parent, id, bitmap, pos, size, style, validator, name)
{
_vc = new ValueCurve(name.ToStdString());
}
示例9: HttpGet
static void HttpGet(const wxString& url, std::shared_ptr<wxString>& str)
{
CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, url.ToStdString().c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HttpGet_WriteStr);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, reinterpret_cast<wxString *>(str.get()));
curl_easy_setopt(curl, CURLOPT_USERAGENT, ua.ToStdString().c_str());
//curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L); // 10 sek
CURLcode result = curl_easy_perform(curl);
if (result != CURLE_OK) {
//wxLogError("Błąd połączenia z URL %s (%s)", url.c_str(), curl_easy_strerror(result));
}
curl_easy_cleanup(curl);
}
示例10: sizeof
SectionInfo::SectionInfo(const wxString& _name)
{
name = _name.ToStdString();
memset(&shdr, 0, sizeof(Elf64_Shdr));
section_num = sections_list.Add(this);
shdr.sh_offset = section_offs;
shdr.sh_name = section_name_offs;
section_name_offs += name.length() + 1;
}
示例11: OpenComPortPhysical
bool OCP_DataStreamInput_Thread::OpenComPortPhysical(const wxString &com_name, int baud_rate)
{
try {
m_serial.setPort(com_name.ToStdString());
m_serial.setBaudrate(baud_rate);
m_serial.open();
m_serial.setTimeout(250, 250, 0, 250, 0);
} catch (std::exception &e) {
//std::cerr << "Unhandled Exception while opening serial port: " << e.what() << std::endl;
}
return m_serial.isOpen();
}
示例12: setTexture
// -----------------------------------------------------------------------------
// Sets the texture to display
// -----------------------------------------------------------------------------
void FlatTexCanvas::setTexture(const wxString& tex)
{
texname_ = tex;
if (tex.empty() || tex == "-")
texture_ = 0;
else
texture_ = MapEditor::textureManager()
.flat(tex.ToStdString(), Game::configuration().featureSupported(Game::Feature::MixTexFlats))
.gl_id;
Refresh();
}
示例13: ShouldRename
bool RebrandingHelper::ShouldRename(wxString scope) const
{
if (rename.find(scope) != rename.end())
return true;
for(auto & it : renameRegex)
{
if (std::regex_match(scope.ToStdString(), it.first))
return true;
}
return false;
}
示例14: ExportOGRLayer
/**
* Exporting OGR layer in project to another datasource name
* This function will be called by OnOKClick (When user clicks OK)
*/
void ExportDataDlg::ExportOGRLayer(wxString& ds_name, bool is_update)
{
// Exporting layer in multi-layer cases will not use OGRTable anymore,
// we will use OGRDataAdapter to get ogr layer by layer name
OGRTable* tbl = dynamic_cast<OGRTable*>(project_p->GetTableInt());
if (!tbl) {
// DBFTable case, try to read into
wxString msg = "Only OGR datasource can be exported now.";
throw GdaException(msg.mb_str());
}
OGRLayerProxy* layer = tbl->GetOGRLayer();
layer->T_Export(ds_format.ToStdString(), ds_name.ToStdString(),
layer_name.ToStdString(), is_update);
int prog_n_max = project_p->GetNumRecords();
wxProgressDialog prog_dlg("Export data source progress dialog",
"Exporting data...",
prog_n_max, // range
this,
wxPD_CAN_ABORT|wxPD_AUTO_HIDE|wxPD_APP_MODAL);
bool cont = true;
while (layer->export_progress < prog_n_max) {
wxSleep(1);
cont = prog_dlg.Update(layer->export_progress);
if (!cont ) {
layer->T_StopExport();
return;
}
if (layer->export_progress == -1){
ostringstream msg;
msg << "Exporting to data source (" << ds_name.ToStdString()
<< ") failed." << "\n\nDetails:"
<< layer->error_message.str();
throw GdaException(msg.str().c_str());
}
}
}
示例15: GetNewName
wxString RebrandingHelper::GetNewName(wxString scope) const
{
if (rename.find(scope) != rename.end())
return rename.find(scope)->second;
for(auto & it : renameRegex)
{
if (std::regex_match(scope.ToStdString(), it.first))
return it.second;
}
return "";
}