本文整理汇总了C++中StringStorage::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringStorage::getString方法的具体用法?C++ StringStorage::getString怎么用?C++ StringStorage::getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringStorage
的用法示例。
在下文中一共展示了StringStorage::getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAdapter
void WinDxgiDevice::getAdapter(IDXGIAdapter **dxgiAdapter) {
HRESULT hr = m_dxgiDevice->GetAdapter(dxgiAdapter);
if (FAILED(hr)) {
StringStorage errMess;
errMess.format(_T("Can't get default Adapter for IDXGIDevice (%ld)"), (long)hr);
throw Exception(errMess.getString());
}
}
示例2: apply
void AdministrationConfigDialog::apply()
{
StringStorage logLevelStringStorage;
m_logLevel.getText(&logLevelStringStorage);
int logLevel = 0;
StringParser::parseInt(logLevelStringStorage.getString(), &logLevel);
m_config->setLogLevel(logLevel);
bool alwaysShared = false;
bool neverShared = false;
bool disconnectClients = false;
if (m_shared[0].isChecked()) {
alwaysShared = true;
neverShared = false;
disconnectClients = false;
} else if (m_shared[1].isChecked()) {
alwaysShared = false;
neverShared = true;
disconnectClients = false;
} else if (m_shared[2].isChecked()) {
alwaysShared = false;
neverShared = true;
disconnectClients = true;
} else if (m_shared[3].isChecked()) {
alwaysShared = false;
neverShared = false;
disconnectClients = false;
} else if (m_shared[4].isChecked()) {
alwaysShared = false;
neverShared = false;
disconnectClients = true;
}
m_config->useControlAuth(m_useControlAuth.isChecked());
if (m_cpControl->hasPassword()) {
m_config->setControlPassword((const unsigned char *)m_cpControl->getCryptedPassword());
} else {
m_config->deleteControlPassword();
}
if (m_disconnectAction[0].isChecked()) {
m_config->setDisconnectAction(ServerConfig::DA_DO_NOTHING);
} else if (m_disconnectAction[1].isChecked()) {
m_config->setDisconnectAction(ServerConfig::DA_LOCK_WORKSTATION);
} else if (m_disconnectAction[2].isChecked()) {
m_config->setDisconnectAction(ServerConfig::DA_LOGOUT_WORKSTATION);
}
m_config->setAlwaysShared(alwaysShared);
m_config->setNeverShared(neverShared);
m_config->disconnectExistingClients(disconnectClients);
m_config->saveLogToAllUsersPath(m_logForAllUsers.isChecked());
}
示例3: assignHandlesFor
void AnonymousPipe::assignHandlesFor(HANDLE hTargetProc, bool neededToClose,
bool keepCloseRight)
{
HANDLE hSrcProc = GetCurrentProcess();
HANDLE hWrite = 0, hRead = 0;
if (DuplicateHandle(hSrcProc, m_hWrite, hTargetProc, &hWrite, 0, FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS) == 0) {
StringStorage errText;
Environment::getErrStr(_T("Cannot dupplicate write")
_T(" handle for the anonymous pipe"),
&errText);
throw Exception(errText.getString());
}
m_hWrite = hWrite;
if (DuplicateHandle(hSrcProc, m_hRead, hTargetProc, &hRead, 0, FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS) == 0) {
StringStorage errText;
Environment::getErrStr(_T("Cannot dupplicate read")
_T(" handle for the anonymous pipe"),
&errText);
throw Exception(errText.getString());
}
m_hRead = hRead;
// Try keep of the close rights.
if (keepCloseRight) {
if (DuplicateHandle(hTargetProc, m_hWrite, 0, 0, 0, FALSE,
DUPLICATE_CLOSE_SOURCE) == 0) {
StringStorage errText;
Environment::getErrStr(_T("Cannot keep the right to close of the write")
_T(" handle of the anonymous pipe"),
&errText);
throw Exception(errText.getString());
}
if (DuplicateHandle(hTargetProc, m_hRead, 0, 0, 0, FALSE,
DUPLICATE_CLOSE_SOURCE) == 0) {
StringStorage errText;
Environment::getErrStr(_T("Cannot keep the right to close of the read")
_T(" handle of the anonymous pipe"),
&errText);
throw Exception(errText.getString());
}
// Now the current process can close the handles.
}
m_neededToClose = neededToClose;
}
示例4: isUserDataValid
bool EditPortMappingDialog::isUserDataValid()
{
StringStorage rectStringStorage;
StringStorage portStringStorage;
m_geometryTextBox.getText(&rectStringStorage);
m_portTextBox.getText(&portStringStorage);
if (!PortMappingRect::tryParse(rectStringStorage.getString())) {
MessageBox(m_ctrlThis.getWindow(),
StringTable::getString(IDS_INVALID_PORT_MAPPING_STRING),
StringTable::getString(IDS_CAPTION_BAD_INPUT),
MB_OK | MB_ICONWARNING);
m_geometryTextBox.setFocus();
return false;
}
int port;
StringParser::parseInt(portStringStorage.getString(), &port);
if ((port < 1) || (port > 65535)) {
MessageBox(m_ctrlThis.getWindow(),
StringTable::getString(IDS_PORT_RANGE_ERROR),
StringTable::getString(IDS_CAPTION_BAD_INPUT),
MB_OK | MB_ICONWARNING);
m_portTextBox.setFocus();
return false;
}
PortMappingContainer *extraPorts = Configurator::getInstance()->getServerConfig()->getPortMappingContainer();
size_t index = extraPorts->findByPort(port);
if ((index != (size_t)-1) && (extraPorts->at(index) != m_mapping)) {
MessageBox(m_ctrlThis.getWindow(),
StringTable::getString(IDS_PORT_ALREADY_IN_USE),
StringTable::getString(IDS_CAPTION_BAD_INPUT),
MB_OK | MB_ICONWARNING);
m_portTextBox.setFocus();
return false;
}
return true;
}
示例5: onFileListReply
void FileTransferReplyBuffer::onFileListReply()
{
UINT8 compressionLevel = 0;
UINT32 compressedSize = 0;
UINT32 uncompressedSize = 0;
UINT8 *buffer = NULL;
{
omni_mutex_lock l(*m_readMutex);
compressionLevel = m_dataInputStream->readUInt8();
compressedSize = m_dataInputStream->readUInt32();
uncompressedSize = m_dataInputStream->readUInt32();
buffer = readCompressedDataBlock(compressedSize,
uncompressedSize,
compressionLevel);
}
ByteArrayInputStream memoryInputStream((char *)buffer, uncompressedSize);
DataInputStream filesInfoReader(&memoryInputStream);
if (m_filesInfo != NULL) {
delete[] m_filesInfo;
}
try {
m_filesInfoCount = filesInfoReader.readUInt32();
m_filesInfo = new FileInfo[m_filesInfoCount];
for (UINT32 i = 0; i < m_filesInfoCount; i++) {
FileInfo *fileInfo = &m_filesInfo[i];
fileInfo->setSize(filesInfoReader.readUInt64());
fileInfo->setLastModified(filesInfoReader.readUInt64());
fileInfo->setFlags(filesInfoReader.readUInt16());
StringStorage t;
filesInfoReader.readUTF8(&t);
fileInfo->setFileName(t.getString());
}
} catch (IOException &ioEx) {
delete[] buffer;
throw ioEx;
}
Log::info(_T("Recieved file list reply: \n")
_T("\t files count = %d\n")
_T("\t use compression = %d\n"),
m_filesInfoCount, compressionLevel);
delete[] buffer;
}
示例6: renameTo
bool File::renameTo(File *dest)
{
StringStorage destPathName;
dest->getPath(&destPathName);
if (MoveFile(m_pathName.getString(), destPathName.getString()) == 0) {
return false;
}
return true;
}
示例7: onInitDialog
BOOL ConfirmDialog::onInitDialog()
{
setControlById(m_text, IDC_CONFIRM_TEXT);
StringStorage text;
text.format(_T("管理员%s需要控制您的电脑,确定?"), m_tvnServerApplication->getUser().getString());
m_text.setText(text.getString());
return TRUE;
}
示例8: execute
int QueryConnectionApplication::execute(const TCHAR *peerAddr, bool acceptByDefault, DWORD timeOutSec)
{
StringStorage curModulePath;
StringStorage command;
Environment::getCurrentModulePath(&curModulePath);
command.format(_T("%s %s %s %s %s %s %d"),
curModulePath.getString(),
QueryConnectionCommandLine::QUERY_CONNECTION,
QueryConnectionCommandLine::PEER_ADDR,
peerAddr,
acceptByDefault ? QueryConnectionCommandLine::ACCEPT : _T(""),
QueryConnectionCommandLine::TIMEOUT,
timeOutSec);
Process *process = 0;
int defaultRetCode = acceptByDefault ? 0 : 1;
int retCode = defaultRetCode;
if (Configurator::getInstance()->getServiceFlag()) {
process = new CurrentConsoleProcess(command.getString());
} else {
process = new Process(command.getString());
}
try {
process->start();
process->waitForExit();
retCode = process->getExitCode();
} catch (Exception &ex) {
Log::error(ex.getMessage());
}
delete process;
if (retCode != 0 && retCode != 1) {
retCode = defaultRetCode;
}
return retCode;
}
示例9: handshake
void RemoteViewerCore::handshake()
{
char serverProtocol[13];
serverProtocol[12] = 0;
m_input->readFully(serverProtocol, 12);
m_major = strtol(&serverProtocol[4], 0, 10);
m_minor = strtol(&serverProtocol[8], 0, 10);
m_isTight = false;
m_logWriter.info(_T("Server sent protocol version: %s"), getProtocolString().getString());
if (!isRfbProtocolString(serverProtocol) ||
m_major < 3 ||
(m_major == 3 && m_minor < 3)) {
StringStorage error;
AnsiStringStorage protocolAnsi(serverProtocol);
StringStorage protocol;
protocolAnsi.toStringStorage(&protocol);
error.format(_T("Unsupported protocol: %s"), protocol.getString());
m_logWriter.error(_T("%s"), error.getString());
throw Exception(error.getString());
}
// if version is 4.0 or later, then set version 3.8.
if (m_major > 3) {
m_major = 3;
m_minor = 8;
} else { // else set version from list 3.3, 3.7, 3.8.
// select minor version:
if (m_minor < 7) {
m_minor = 3;
}
if (m_minor >= 8) {
m_minor = 8;
}
}
m_logWriter.info(_T("Send to server protocol version: %s"), getProtocolString().getString());
AnsiStringStorage clientProtocolAnsi;
clientProtocolAnsi.fromStringStorage(&getProtocolString());
m_output->writeFully(clientProtocolAnsi.getString(), 12);
m_output->flush();
}
示例10: testNum
bool VncViewerConfigDialog::testNum(TextBox *tb, const TCHAR *tbName)
{
StringStorage text;
tb->getText(&text);
if (StringParser::tryParseInt(text.getString())) {
return true;
}
StringStorage message;
message.format(_T("Value in field '%s' must be numeric"), tbName);
MessageBox(m_ctrlThis.getWindow(), message.getString(),
_T("VNCViewer general config"), MB_OK | MB_ICONWARNING);
tb->setFocus();
return false;
}
示例11: setString
void WinFilePath::setString(const TCHAR *string)
{
StringStorage str(string);
if (!str.isEmpty()) {
if (str.findLast('/') == 0) {
m_parentPathIsRoot = true;
}
str.replaceChar(_T('/'), _T('\\'));
if (str.beginsWith(_T('\\'))) {
str.remove(0, 1);
}
if (str.endsWith(_T('\\'))) {
str.truncate(1);
}
}
// desktop replacement
//TCHAR path[MAX_PATH + 1];
StringStorage specFolder;
str.getSubstring(&specFolder,0,8);
if(specFolder.isEqualTo(_T("[Desktop]"))){
StringStorage tmp;
str.getSubstring(&tmp,9,str.getLength());
Environment::getSpecialFolderPath(Environment::USERDESKTOP_DATA_SPECIAL_FOLDER, &specFolder);
str.setString(specFolder.getString());
str.appendString(tmp.getString());
}
str.getSubstring(&specFolder,0,5);
if(specFolder.isEqualTo(_T("[Docs]"))){
StringStorage tmp;
str.getSubstring(&tmp,6,str.getLength());
Environment::getSpecialFolderPath(Environment::USERDOCS_DATA_SPECIAL_FOLDER, &specFolder);
str.setString(specFolder.getString());
str.appendString(tmp.getString());
}
StringStorage::setString(str.getString());
}
示例12: checkDimension
void DesktopServerProto::checkDimension(const Dimension *dim)
{
StringStorage errMess;
if (abs(dim->width) > 64000 ||
abs(dim->height) > 64000) {
errMess.format(_T("Wrong dimension (%dx%d)"), dim->width,
dim->height);
throw Exception(errMess.getString());
}
}
示例13: RegistrySettingsManager
ConnectionConfigSM::ConnectionConfigSM(const TCHAR registryPath[],
const TCHAR entryName[])
: RegistrySettingsManager()
{
StringStorage keyName;
keyName.format(_T("%s\\History\\%s"),
registryPath,
entryName);
setRegistryKey(Registry::getCurrentUserKey(), keyName.getString());
}
示例14: updateCaption
void ConfigDialog::updateCaption()
{
StringStorage caption;
caption.format(StringTable::getString(IDS_SERVER_CONFIG_CAPTION_FORMAT),
StringTable::getString(m_isConfiguringService ? IDS_SERVICE : IDS_SERVER),
m_reloadConfigCommand == 0 ? StringTable::getString(IDS_OFFLINE_MODE) : _T(""));
m_ctrlThis.setText(caption.getString());
}
示例15: notifyFailedToDownload
void DownloadOperation::notifyFailedToDownload(const TCHAR *errorDescription)
{
StringStorage message;
message.format(_T("Error: failed to download '%s' (%s)"),
m_pathToSourceFile.getString(),
errorDescription);
notifyError(message.getString());
}