本文整理汇总了C++中wxString::To8BitData方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::To8BitData方法的具体用法?C++ wxString::To8BitData怎么用?C++ wxString::To8BitData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::To8BitData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddFileWithMimeType
/*static*/
void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename,
const wxString& textdata,
const wxString& mimetype)
{
AddFileWithMimeType
(
filename,
static_cast<const char *>(textdata.To8BitData()),
wxStrlen(static_cast<const char *>(textdata.To8BitData())),
mimetype
);
}
示例2: open
bool
JobCtrl_calculate_checksum(const wxString &file, u_int8_t *cs, int cslen)
{
SHA256_CTX shaCtx;
int fd, nread;
unsigned char buf[1024];
if ((cs == NULL) || (cslen < ANOUBIS_CS_LEN)) {
return (false);
}
fd = open(file.To8BitData(), O_RDONLY);
if (fd == -1)
return (false);
SHA256_Init(&shaCtx);
/* Read file chunk by chunk and put it into SHA256_CTX */
while ((nread = read(fd, buf, sizeof(buf))) > 0) {
SHA256_Update(&shaCtx, buf, nread);
}
SHA256_Final(cs, &shaCtx);
close(fd);
if (nread == -1) {
/* read operation failed */
return (false);
}
return (true);
}
示例3: AddFileWithMimeType
/*static*/
void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename,
const wxString& textdata,
const wxString& mimetype)
{
const wxCharBuffer buf(textdata.To8BitData());
AddFileWithMimeType(filename, buf.data(), buf.length(), mimetype);
}
示例4: CheckString
void strStream::CheckString(const wxString& text)
{
wxStringOutputStream sos;
const wxCharBuffer buf(text.To8BitData());
sos.Write(buf, buf.length());
CPPUNIT_ASSERT_EQUAL( text, sos.GetString() );
}
示例5: ConvToServer
wxCharBuffer CControlSocket::ConvToServer(const wxString& str, bool force_utf8 /*=false*/)
{
if (m_useUTF8 || force_utf8) {
wxCharBuffer const buffer = str.utf8_str();
if (buffer || force_utf8)
return buffer;
}
if (m_pCSConv) {
wxCharBuffer const buffer = str.mb_str(*m_pCSConv);
if (buffer)
return buffer;
}
wxCharBuffer buffer = str.mb_str(*wxConvCurrent);
if (!buffer)
buffer = str.To8BitData();
return buffer;
}
示例6: string
/**
* \brief Create a std::string from a wxString.
* \param str The reference string.
*/
inline std::string wx_to_std_string( const wxString& str )
{
return std::string( str.To8BitData() );
} // wx_to_std_string()