这篇教程C++ wstring函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wstring函数的典型用法代码示例。如果您正苦于以下问题:C++ wstring函数的具体用法?C++ wstring怎么用?C++ wstring使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wstring函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ZipFile int ZipFile( const WCHAR* inputFile, const WCHAR* outputFile, int method, int compressionLevel ) { int err = -1; if ( ( inputFile != NULL ) && ( outputFile != NULL ) ) { NSFile::CFileBinary oFile; if(oFile.OpenFile(inputFile)) { DWORD dwSizeRead; BYTE* pData = new BYTE[oFile.GetFileSize()]; if(oFile.ReadFile(pData, oFile.GetFileSize(), dwSizeRead)) { zipFile zf = zipOpenHelp(outputFile); zip_fileinfo zi; zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour = zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0; zi.dosDate = 0; zi.internal_fa = 0; zi.external_fa = 0;#if defined(_WIN32) || defined (_WIN64) SYSTEMTIME currTime; GetLocalTime( &currTime ); zi.tmz_date.tm_sec = currTime.wSecond; zi.tmz_date.tm_min = currTime.wMinute; zi.tmz_date.tm_hour = currTime.wHour; zi.tmz_date.tm_mday = currTime.wDay; zi.tmz_date.tm_mon = currTime.wMonth; zi.tmz_date.tm_year = currTime.wYear;#endif wstring inputFileName( inputFile ); wstring::size_type pos = 0; static const wstring::size_type npos = -1; pos = inputFileName.find_last_of( L'//' ); wstring zipFileName; if ( pos != npos ) { zipFileName = wstring( ( inputFileName.begin() + pos + 1 ), inputFileName.end() ); } else { zipFileName = wstring( inputFileName.begin(), inputFileName.end() ); } std::string zipFileNameA = codepage_issue_fixToOEM(zipFileName); err = zipOpenNewFileInZip( zf, zipFileNameA.c_str(), &zi, NULL, 0, NULL, 0, NULL, method, compressionLevel ); err = zipWriteInFileInZip( zf, pData, dwSizeRead ); err = zipCloseFileInZip( zf ); err = zipClose( zf, NULL ); } RELEASEARRAYOBJECTS(pData); } } return false; }
开发者ID:ONLYOFFICE,项目名称:core,代码行数:65,
示例2: GetTempPathvoid OutLookHotmailConnector::GetDownloadConfigurationAndTempFile(ConfigurationFileActionDownload& downloadVersion, wstring& tempFile){ wchar_t szTempPath[MAX_PATH]; GetTempPath(MAX_PATH, szTempPath); downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(MSOfficeLPIActionID, wstring(L"OutlookHotmailConnector")); tempFile = szTempPath; tempFile += downloadVersion.GetFilename().c_str(); m_installerLocation = tempFile;}
开发者ID:Softcatala,项目名称:Catalanitzador,代码行数:11,
示例3: assert/*************************************************************************** * bitwise Not operator * (1) take value from stack * (2) ~result(1) * (3) push result (2) ***************************************************************************/void CCilVm::bitwiseNotOperator(){ assert( getEvalStackSize() >= 1 ); CVariable& lhs = getEvalStackFirstEntry(); int32_t i; int64_t i64; if( lhs.iOperandType == OPERAND_OBJECTREF ) { OPERAND_TYPE lhsType = lhs.getPrimitiveType( PRIMITIVETYPE_NUMBER ); switch( lhsType ) { case OPERAND_OBJECTREF: //Throw TypeError popEvalStack(); pushEvalStackNaN(); ThrowExceptionFromVm( &wstring( ERRORSTRING_TYPEERROR_STORESTATICFIELD ), &wstring( NAME_BUILTIN_ERROR_OBJECT ), ERROR_TYPEERROR_STORESTATICFIELD ); return; case OPERAND_UNDEFINED: popEvalStack(); pushEvalStackUndefined(); return; case OPERAND_NAN: popEvalStack(); pushEvalStackNaN(); return; case OPERAND_STRING: case OPERAND_DOUBLE: case OPERAND_FLOAT: case OPERAND_INT: case OPERAND_BOOLEAN: i = ~lhs.toInt(); popEvalStack(); pushEvalStack( i ); return; case OPERAND_INT64: i64 = ~lhs.toInt64(); popEvalStack(); pushEvalStack( i64 ); return; default: Debug_Fatal( "Not implemented yet" ); } } switch( lhs.iOperandType ) { case OPERAND_INT: lhs.iValue = ~lhs.iValue; break; case OPERAND_INT64: lhs.i64Value = ~lhs.i64Value; break; case OPERAND_NAN: popEvalStack(); pushEvalStackNaN(); break; case OPERAND_UNDEFINED: popEvalStack(); pushEvalStackUndefined(); break; case OPERAND_STRING: case OPERAND_FLOAT: case OPERAND_BOOLEAN: case OPERAND_DOUBLE: case OPERAND_NULL: i = ~lhs.toInt(); popEvalStack(); pushEvalStack( i ); break; case OPERAND_OBJECTREF: Debug_Fatal( "Illegal operand" ); break; default: Debug_Fatal( "Illegal operand" ); break; }}
开发者ID:hak,项目名称:criscript,代码行数:88,
示例4: lock/** * Lifecycle: load */void FrameServer::load(HWND toolbar, HWND target, const wstring& uuid, const wstring& title, const wstring& icon, DWORDX processId, INT_PTRX proxy){ logger->debug(L"FrameServer::load" L" -> " + boost::lexical_cast<wstring>(toolbar) + L" -> " + boost::lexical_cast<wstring>(target) + L" -> " + uuid + L" -> " + title + L" -> " + icon + L" -> " + boost::lexical_cast<wstring>(processId) + L" -> " + boost::lexical_cast<wstring>(proxy)); ATL::CComCritSecLock<CComAutoCriticalSection> lock(m_clientLock, true); if (processId != ::GetCurrentProcessId() && m_clientListeners.find(processId) == m_clientListeners.end()) { // add IPC channel for proxy if it is in a different process m_clientListeners[processId] = ClientListener(new Channel(L"IeBarMsgPoint", processId), 1); if (m_clientListeners.size() == 1) { m_activeProcessId = processId; m_activeProxy = proxy; } } // only initialize the first time if (++m_tabCount != 1) { logger->debug(L"FrameServer::load already initialized"); lock.Unlock(); return; } m_toolbar = toolbar; m_target = target; // subclass windows m_oldWndProcToolbar = (WndProcPtr)::GetWindowLongPtr(m_toolbar, GWLP_WNDPROC); ::SetWindowLongPtr(m_toolbar, GWLP_WNDPROC, (LONG_PTR)WndProcToolbarS); m_oldWndProcTarget = (WndProcPtr)::GetWindowLongPtr(m_target, GWLP_WNDPROC); ::SetWindowLongPtr(m_target, GWLP_WNDPROC, (LONG_PTR)WndProcTargetS); lock.Unlock(); // add button HRESULT hr; Button button; hr = button_addCommand(uuid.c_str(), title.c_str(), icon.c_str()).exec(toolbar, target, &button); if (FAILED(hr)) { logger->error(L"FrameServer::load failed to create button" L" -> " + logger->parse(hr)); ::MessageBox(NULL, wstring(L"Forge could not create button. Please check that " L"your icon file is a 16x16 bitmap in .ico format: " L"'" + icon + L"'").c_str(), VENDOR_COMPANY_NAME, MB_TASKMODAL | MB_ICONEXCLAMATION); return; } lock.Lock(); m_buttons[uuid] = button; lock.Unlock(); }
开发者ID:EduardoMartinezCatala,项目名称:browser-extensions,代码行数:67,
示例5: generic_wstring const std::wstring generic_wstring() const { return wstring(codecvt()); }
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:1,
示例6: OnMountPointButtonClick void MountOptionsDialog::OnMountPointButtonClick (wxCommandEvent& event) { DirectoryPath dir = Gui->SelectDirectory (this, wxEmptyString, false); if (!dir.IsEmpty()) MountPointTextCtrl->SetValue (wstring (dir)); }
开发者ID:ChiefGyk,项目名称:VeraCrypt,代码行数:6,
示例7: wstring void KeyfileGeneratorDialog::OnGenerateButtonClick (wxCommandEvent& event) { try { int keyfilesCount = NumberOfKeyfiles->GetValue(); int keyfilesSize = KeyfilesSize->GetValue(); bool useRandomSize = RandomSizeCheckBox->IsChecked(); wxString keyfileBaseName = KeyfilesBaseName->GetValue(); keyfileBaseName.Trim(true); keyfileBaseName.Trim(false); if (keyfileBaseName.IsEmpty()) { Gui->ShowWarning("KEYFILE_EMPTY_BASE_NAME"); return; } wxFileName baseFileName = wxFileName::FileName (keyfileBaseName); if (!baseFileName.IsOk()) { Gui->ShowWarning("KEYFILE_INVALID_BASE_NAME"); return; } DirectoryPath keyfilesDir = Gui->SelectDirectory (Gui->GetActiveWindow(), LangString["SELECT_KEYFILE_GENERATION_DIRECTORY"], false); if (keyfilesDir.IsEmpty()) return; wxFileName dirFileName = wxFileName::DirName( wstring(keyfilesDir).c_str() ); if (!dirFileName.IsDirWritable ()) { Gui->ShowWarning(L"You don't have write permission on the selected directory"); return; } wxBusyCursor busy; for (int i = 0; i < keyfilesCount; i++) { int bufferLen; if (useRandomSize) { SecureBuffer sizeBuffer (sizeof(int)); RandomNumberGenerator::GetData (sizeBuffer, true); memcpy(&bufferLen, sizeBuffer.Ptr(), sizeof(int)); /* since keyfilesSize < 1024 * 1024, we mask with 0x000FFFFF */ bufferLen = (long) (((unsigned long) bufferLen) & 0x000FFFFF); bufferLen %= ((1024*1024 - 64) + 1); bufferLen += 64; } else bufferLen = keyfilesSize; SecureBuffer keyfileBuffer (bufferLen); RandomNumberGenerator::GetData (keyfileBuffer, true); wstringstream convertStream; convertStream << i; wxString suffix = L"_"; suffix += convertStream.str().c_str(); wxFileName keyfileName; if (i == 0) { keyfileName.Assign(dirFileName.GetPath(), keyfileBaseName); } else { if (baseFileName.HasExt()) { keyfileName.Assign(dirFileName.GetPath(), baseFileName.GetName() + suffix + L"." + baseFileName.GetExt()); } else { keyfileName.Assign(dirFileName.GetPath(), keyfileBaseName + suffix); } } if (keyfileName.Exists()) { wxString msg = wxString::Format(LangString["KEYFILE_ALREADY_EXISTS"], keyfileName.GetFullPath()); if (!Gui->AskYesNo (msg, false, true)) return; } { FilePath keyfilePath((const wchar_t*) keyfileName.GetFullPath()); File keyfile; keyfile.Open (keyfilePath, File::CreateWrite); keyfile.Write (keyfileBuffer); } } Gui->ShowInfo ("KEYFILE_CREATED"); } catch (exception &e) { Gui->ShowError (e);//.........这里部分代码省略.........
开发者ID:josejamilena,项目名称:veracrypt,代码行数:101,
示例8: UnicodeToMultibyteJson::String Json::multibyte() const { return UnicodeToMultibyte(wstring()); }
开发者ID:ospace,项目名称:jsonlite_cpp,代码行数:1,
示例9: getQueryTemplateFromDBwstring QueryAssembler::CreateQuery(const FilledFrame& targetFrame, const NetEvaluator& evaluator, std::wstring& question){ wstring toReturn = L""; currentFrameTense = targetFrame.GetTense(); wstring qTemplate = getQueryTemplateFromDB(targetFrame.GetSemanticFrame()->GetFrameName(), pathToDb); queryTemplate = parseTemplate(qTemplate); vector<wstring> queryParts; queryParts.push_back(L""); wstring queryClause; bool timeSpecified = false; for(auto slot_p = targetFrame.GetSlotIterator(); slot_p != targetFrame.GetSlotEndIterator(); slot_p++) { if((*slot_p)->GetNetName() == CONST_QUERY) //if this is a [Query] slot, we extract key word for question type for it: why, where, when... { question = evaluator.Evaluate(*slot_p, currentFrameTense)[NetEvaluator::VALUE]; } try { if(queryTemplate.find((*slot_p)->GetNetName()) != queryTemplate.end()) { queryClause = interpolate(queryTemplate.at((*slot_p)->GetNetName()), *slot_p, evaluator); if((*slot_p)->IsExternal()) //now it just means that we encountered time expression { timeSpecified = true; } if(queryClause.find(L"SELECT") == 0) //we reserve first position for the SELECT clause { if(queryClause.find(L"WHERE") == wstring::npos) queryClause.append(L" WHERE 1=1"); queryParts[0] = queryClause; } else if(!queryClause.empty()) // other parts of the query are joined by conjunction { queryClause = wstring(L" AND ").append(queryClause); queryParts.push_back(queryClause); } } } catch(...) { throw EInvalidTemplate(targetFrame.GetSemanticFrame()->GetFrameName().c_str()); } } if(queryParts[0].empty()) //if we didn't find any slot which could determine source table we force select from Afisha { //throw 0; queryParts[0] = L"SELECT Year, Sport, Event, Athlete, Result, Medal, Country, Country_Taker, City_Taker, Season, COUNT(*) as Times FROM OlympData WHERE 1=1"; } if(!timeSpecified) //if we didn't find any slot which could determine time we set default timex slot based on tense { Slots def_timex = createDefaultTimex(currentFrameTense); shared_ptr<IMatch> def_time_match = shared_ptr<IMatch>(new TimexMatch(def_timex)); //Print("/home/stepan/zz.txt", queryTemplate); wstring sdklfdjfdskljfds = def_time_match->GetNetName(); queryClause = L" AND " + interpolate(queryTemplate.at(def_time_match->GetNetName()), def_time_match, evaluator); queryParts.push_back(queryClause); } for(size_t i = 0; i < queryParts.size(); i++) { toReturn.append(queryParts[i]); } return toReturn;}
开发者ID:Samsung,项目名称:veles.nlp,代码行数:78,
示例10: Import EXPORT void Import(string scPluginCfgFile, bool emptyFail) { int boardIndex = 0; string boardIndexStr = ""; string errorMessage = ""; Data::ParameterSet parameters; INI_Reader ini; if (!ini.open(scPluginCfgFile.c_str(), false)) { Common::PrintConInfo(L"Can't read config file. Don't see any possibility to load. Aborted.", true); return; } while (ini.read_header()) { if (ini.is_header("API")) { Sync::APILogin login; Sync::APIServer server; boardIndex++; while (ini.read_value()) { if (ini.is_value("URI")) { login.URI = ini.get_value_string(0); } else if (ini.is_value("Account")) { login.Account = ini.get_value_string(0); } else if (ini.is_value("Password")) { login.Password = ini.get_value_string(0); } else if (ini.is_value("Secret")) { login.Secret = Misc::Encode::stringToInt(ini.get_value_string(0)); } else if (ini.is_value("Queue")) { login.Queue = ini.get_value_int(0); } else if (ini.is_value("Operation")) { login.Operations.push_back(ini.get_value_string(0)); } else if (ini.is_value("Response")) { login.Responses.push_back(ini.get_value_string(0)); } } if (login.URI == "" || login.Account == "" || login.Password == "") { boardIndexStr = itos(boardIndex); Common::PrintConInfo(L"There is an error on configuration: At least one of the parameter (URI, Account, Password) is missing for [API] " + wstring(boardIndexStr.begin(), boardIndexStr.end()) + L". Ignoring./r/n", true); continue; } try { server = Sync::Client::Get(login); Data::ParameterData data; data[L"Name"] = server.Name; data[L"LastSent"] = (uint)server.LastSent; data[L"Queue"] = server.QueueLimit; data[L"Delay"] = server.Delay; Data::Parameter parameter(data); parameters.push_back(parameter); } catch (exception &e) { errorMessage = e.what(); Common::PrintConInfo(L"Got a failure when try to load setting for API " + wstring(login.URI.begin(), login.URI.end()) + L": " + wstring(errorMessage.begin(), errorMessage.end())); } } } Config::Config::APIs = parameters; ini.close(); if (emptyFail && boardIndex <= 0) { Common::PrintConInfo(L"No board information. Don't see why loading. Aborted.", true); return; } }
开发者ID:HeIIoween,项目名称:FLBoard,代码行数:97,
示例11: wstringwstring Gine::Utils::ToWString(const string* s){ return wstring(s->begin(), s->end());}
开发者ID:gr3gu,项目名称:Suckoban,代码行数:4,
示例12: set_text /// set the window text. // @function set_text def set_text(Str text) { SetWindowTextW(this->hwnd,wstring(text)); return 0; }
开发者ID:ignacio,项目名称:winapi,代码行数:6,
示例13: getDirstatic wstring getDir(const wstring& path) { wchar_t drive[_MAX_DRIVE] = {0}, dir[_MAX_DIR] = {0}; _wsplitpath_s(path.c_str(), drive, _MAX_DRIVE, dir, _MAX_DIR, NULL, 0, NULL, 0); return wstring(drive) + wstring(dir);}
开发者ID:xcodez,项目名称:jsfs,代码行数:5,
示例14: updatebool update() { writeLog(L"Update started.."); wstring updDir = L"tupdates//temp", readyFilePath = L"tupdates//temp//ready", tdataDir = L"tupdates//temp//tdata"; { HANDLE readyFile = CreateFile(readyFilePath.c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (readyFile != INVALID_HANDLE_VALUE) { CloseHandle(readyFile); } else { updDir = L"tupdates//ready"; // old tdataDir = L"tupdates//ready//tdata"; } } HANDLE versionFile = CreateFile((tdataDir + L"//version").c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (versionFile != INVALID_HANDLE_VALUE) { if (!ReadFile(versionFile, &versionNum, sizeof(DWORD), &readLen, NULL) || readLen != sizeof(DWORD)) { versionNum = 0; } else { if (versionNum == 0x7FFFFFFF) { // beta version } else if (!ReadFile(versionFile, &versionLen, sizeof(DWORD), &readLen, NULL) || readLen != sizeof(DWORD) || versionLen > 63) { versionNum = 0; } else if (!ReadFile(versionFile, versionStr, versionLen, &readLen, NULL) || readLen != versionLen) { versionNum = 0; } } CloseHandle(versionFile); writeLog(L"Version file read."); } else { writeLog(L"Could not open version file to update registry :("); } deque<wstring> dirs; dirs.push_back(updDir); deque<wstring> from, to, forcedirs; do { wstring dir = dirs.front(); dirs.pop_front(); wstring toDir = updateTo; if (dir.size() > updDir.size() + 1) { toDir += (dir.substr(updDir.size() + 1) + L"//"); forcedirs.push_back(toDir); writeLog(L"Parsing dir '" + toDir + L"' in update tree.."); } WIN32_FIND_DATA findData; HANDLE findHandle = FindFirstFileEx((dir + L"//*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); if (findHandle == INVALID_HANDLE_VALUE) { DWORD errorCode = GetLastError(); if (errorCode == ERROR_PATH_NOT_FOUND) { // no update is ready return true; } writeLog(L"Error: failed to find update files :("); updateError(L"Failed to find update files", errorCode); delFolder(); return false; } do { wstring fname = dir + L"//" + findData.cFileName; if (fname.substr(0, tdataDir.size()) == tdataDir && (fname.size() <= tdataDir.size() || fname.at(tdataDir.size()) == '/')) { writeLog(L"Skipped 'tdata' path '" + fname + L"'"); } else if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if (findData.cFileName != wstring(L".") && findData.cFileName != wstring(L"..")) { dirs.push_back(fname); writeLog(L"Added dir '" + fname + L"' in update tree.."); } } else { wstring tofname = updateTo + fname.substr(updDir.size() + 1); if (equal(tofname, updaterName)) { // bad update - has Updater.exe - delete all dir writeLog(L"Error: bad update, has Updater.exe! '" + tofname + L"' equal '" + updaterName + L"'"); delFolder(); return false; } else if (equal(tofname, updateTo + L"Telegram.exe") && exeName != L"Telegram.exe") { wstring fullBinaryPath = updateTo + exeName; writeLog(L"Target binary found: '" + tofname + L"', changing to '" + fullBinaryPath + L"'"); tofname = fullBinaryPath; } if (equal(fname, readyFilePath)) { writeLog(L"Skipped ready file '" + fname + L"'"); } else { from.push_back(fname); to.push_back(tofname); writeLog(L"Added file '" + fname + L"' to be copied to '" + tofname + L"'"); } } } while (FindNextFile(findHandle, &findData)); DWORD errorCode = GetLastError(); if (errorCode && errorCode != ERROR_NO_MORE_FILES) { // everything is found writeLog(L"Error: failed to find next update file :("); updateError(L"Failed to find next update file", errorCode); delFolder(); return false; } FindClose(findHandle); } while (!dirs.empty());//.........这里部分代码省略.........
开发者ID:Federated-Blockchains-Initiative,项目名称:tdesktop,代码行数:101,
示例15: RDCEraseElSocket *CreateClientSocket(const wchar_t *host, uint16_t port, int timeoutMS){ char portstr[7] = {0}; StringFormat::snprintf(portstr, 6, "%d", port); addrinfo hints; RDCEraseEl(hints); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; wstring hostWide = wstring(host); string hoststr = narrow(hostWide); if(widen(hoststr) != hostWide) RDCWARN("Unicode hostname truncated: %S", hostWide.c_str()); addrinfo *result = NULL; getaddrinfo(hoststr.c_str(), portstr, &hints, &result); for(addrinfo *ptr = result; ptr != NULL; ptr = ptr->ai_next) { int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(s == -1) return NULL; int flags = fcntl(s, F_GETFL, 0); fcntl(s, F_SETFL, flags | O_NONBLOCK); int result = connect(s, ptr->ai_addr, (int)ptr->ai_addrlen); if(result == -1) { fd_set set; FD_ZERO(&set); FD_SET(s, &set); int err = errno; if(err == EWOULDBLOCK) { timeval timeout; timeout.tv_sec = (timeoutMS/1000); timeout.tv_usec = (timeoutMS%1000)*1000; result = select(0, NULL, &set, NULL, &timeout); if(result <= 0) { RDCDEBUG("connect timed out"); close(s); continue; } else { RDCDEBUG("connect before timeout"); } } else { RDCDEBUG("problem other than blocking"); close(s); continue; } } else { RDCDEBUG("connected immediately"); } int nodelay = 1; setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *)&nodelay, sizeof(nodelay)); return new Socket((ptrdiff_t)s); } RDCWARN("Failed to connect to %S:%d", host, port); return NULL;}
开发者ID:CSRedRat,项目名称:renderdoc,代码行数:79,
示例16: wstring bptr < WideString > Util::toWideString(const std::string & s) { bptr < WideString > wstring(new WideString(s.c_str())); return wstring; };
开发者ID:beaver999,项目名称:mygoodjob,代码行数:4,
示例17: extract wstring extract(const wchar_t* end_chars) { size_t start = pos; while (!end() && !is_one_of(text[pos], end_chars)) pos++; return wstring(text.data() + start, pos - start); }
开发者ID:CyberShadow,项目名称:FAR,代码行数:6,
示例18: assertbool MSOfficeLPIAction::Download(ProgressStatus progress, void *data){ bool bFile1, bFile2; ConfigurationFileActionDownload downloadVersion; assert(_getDownloadID() != NULL); downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(GetID(), wstring(_getDownloadID())); wcscpy_s(m_szFilename, downloadVersion.GetFilename().c_str()); wcscpy_s(m_szFullFilename, m_szTempPath); wcscat_s(m_szFullFilename, m_szFilename); bFile1 = m_downloadManager->GetFileAndVerifyAssociatedSha1(downloadVersion, m_szFullFilename, progress, data); if (_needsInstallConnector()) { downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(GetID(), wstring(L"OutlookHotmailConnector")); m_connectorFile = m_szTempPath; m_connectorFile += downloadVersion.GetFilename().c_str(); bFile2 = m_downloadManager->GetFileAndVerifyAssociatedSha1(downloadVersion, m_connectorFile, progress, data); return bFile1 == true && bFile2 == true; } else { return bFile1; }}
开发者ID:xmps,项目名称:Catalanitzador,代码行数:26,
示例19: ft// Print the properties for the given snasphotvoid VssClient::PrintSnapshotProperties(VSS_SNAPSHOT_PROP & prop){ FunctionTracer ft(DBG_INFO); LONG lAttributes = prop.m_lSnapshotAttributes; ft.WriteLine(L"* SNAPSHOT ID = " WSTR_GUID_FMT L" ...", GUID_PRINTF_ARG(prop.m_SnapshotId)); ft.WriteLine(L" - Shadow copy Set: " WSTR_GUID_FMT, GUID_PRINTF_ARG(prop.m_SnapshotSetId)); ft.WriteLine(L" - Original count of shadow copies = %d", prop.m_lSnapshotsCount); ft.WriteLine(L" - Original Volume name: %s [%s]", prop.m_pwszOriginalVolumeName, GetDisplayNameForVolume(prop.m_pwszOriginalVolumeName).c_str() ); ft.WriteLine(L" - Creation Time: %s", VssTimeToString(prop.m_tsCreationTimestamp).c_str()); ft.WriteLine(L" - Shadow copy device name: %s", prop.m_pwszSnapshotDeviceObject); ft.WriteLine(L" - Originating machine: %s", prop.m_pwszOriginatingMachine); ft.WriteLine(L" - Service machine: %s", prop.m_pwszServiceMachine); if (prop.m_lSnapshotAttributes & VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY) ft.WriteLine(L" - Exposed locally as: %s", prop.m_pwszExposedName); else if (prop.m_lSnapshotAttributes & VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY) { ft.WriteLine(L" - Exposed remotely as %s", prop.m_pwszExposedName); if (prop.m_pwszExposedPath && wcslen(prop.m_pwszExposedPath) > 0) ft.WriteLine(L" - Path exposed: %s", prop.m_pwszExposedPath); } else ft.WriteLine(L" - Not Exposed"); ft.WriteLine(L" - Provider id: " WSTR_GUID_FMT, GUID_PRINTF_ARG(prop.m_ProviderId)); // Display the attributes wstring attributes; if (lAttributes & VSS_VOLSNAP_ATTR_TRANSPORTABLE) attributes += wstring(L" Transportable"); if (lAttributes & VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE) attributes += wstring(L" No_Auto_Release"); else attributes += wstring(L" Auto_Release"); if (lAttributes & VSS_VOLSNAP_ATTR_PERSISTENT) attributes += wstring(L" Persistent"); if (lAttributes & VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE) attributes += wstring(L" Client_accessible"); if (lAttributes & VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED) attributes += wstring(L" Hardware"); if (lAttributes & VSS_VOLSNAP_ATTR_NO_WRITERS) attributes += wstring(L" No_Writers"); if (lAttributes & VSS_VOLSNAP_ATTR_IMPORTED) attributes += wstring(L" Imported"); if (lAttributes & VSS_VOLSNAP_ATTR_PLEX) attributes += wstring(L" Plex"); if (lAttributes & VSS_VOLSNAP_ATTR_DIFFERENTIAL) attributes += wstring(L" Differential"); ft.WriteLine(L" - Attributes: %s", attributes.c_str()); ft.WriteLine(L"");}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:67,
示例20: get_console_titlewstring get_console_title() { Buffer<wchar_t> buf(10000); DWORD size = GetConsoleTitleW(buf.data(), static_cast<DWORD>(buf.size())); return wstring(buf.data(), size);}
开发者ID:landswellsong,项目名称:FAR,代码行数:5,
示例21: Channel/** * ProxyListen */DWORD FrameServer::ProxyListen(LPVOID param){ HRESULT hr; logger->debug(L"FrameServer::ProxyListen" L" -> " + boost::lexical_cast<wstring>(param)); FrameServer* pThis = (FrameServer*)param; pThis->m_channel = new Channel(L"IeBarListner", ::GetCurrentProcessId()); while (pThis->m_channel) { char buffer[Channel::SECTION_SIZE]; if (!pThis->m_channel->Read(buffer, Channel::SECTION_SIZE)) { break; } UINTX type = *(UINTX*)buffer; logger->debug(L"FrameServer::ProxyListen" L" -> " + boost::lexical_cast<wstring>(type)); switch(type) { case SendMessageCommand::COMMAND_TYPE: { SendMessageCommand *command = (SendMessageCommand*)buffer; pThis->SendMessage(command->msg, command->wparam, command->lparam); } break; case PostMessageCommand::COMMAND_TYPE: { PostMessageCommand *command = (PostMessageCommand*)buffer; pThis->PostMessage(command->msg, command->wparam, command->lparam); } break; case LoadCommand::COMMAND_TYPE: { LoadCommand *command = (LoadCommand*)buffer; logger->debug(L"FrameServer::ProxyListen LoadCommand" L" -> " + wstring(command->uuid) + L" -> " + wstring(command->title) + L" -> " + wstring(command->icon) + L" -> " + boost::lexical_cast<wstring>(command->addressBarWnd) + L" -> " + boost::lexical_cast<wstring>(command->commandTargetWnd)); pThis->load(reinterpret_cast<HWND>(command->addressBarWnd), reinterpret_cast<HWND>(command->commandTargetWnd), command->uuid, command->title, command->icon, command->processId, command->proxy); } break; case UnloadCommand::COMMAND_TYPE: { UnloadCommand *command = (UnloadCommand*)buffer; pThis->unload(command->processId, command->proxy); } break; case SelectTabCommand::COMMAND_TYPE: { SelectTabCommand *command = (SelectTabCommand*)buffer; pThis->SetCurrentProxy(command->processId, command->proxy); } break; case button_addCommand::COMMAND_TYPE: { Button button; button_addCommand *command = (button_addCommand*)buffer; hr = command->exec(pThis->m_toolbar, pThis->m_target, &button); if (FAILED(hr)) { logger->error(L"FrameServer::ProxyListen button_setIconCommand failed" L" -> " + logger->parse(hr)); } pThis->m_buttons[button.uuid] = button; } break; case button_setIconCommand::COMMAND_TYPE: { button_setIconCommand *command = (button_setIconCommand*)buffer; Button button = pThis->m_buttons[command->uuid]; hr = command->exec(pThis->m_toolbar, pThis->m_target, button.idCommand, button.iBitmap); if (FAILED(hr)) { logger->error(L"FrameServer::ProxyListen button_setIconCommand failed" L" -> " + logger->parse(hr)); } } break; case button_setTitleCommand::COMMAND_TYPE: { button_setTitleCommand *command = (button_setTitleCommand*)buffer; Button button = pThis->m_buttons[command->uuid]; hr = command->exec(pThis->m_toolbar, pThis->m_target, button.idCommand); if (FAILED(hr)) { logger->error(L"FrameServer::ProxyListen button_setTitleCommand failed" L" -> " + logger->parse(hr)); } } break; case button_setBadgeCommand::COMMAND_TYPE: {//.........这里部分代码省略.........
开发者ID:EduardoMartinezCatala,项目名称:browser-extensions,代码行数:101,
示例22: upcasewstring upcase(const wstring& str) { Buffer<wchar_t> up_str(str.size()); wmemcpy(up_str.data(), str.data(), str.size()); CharUpperBuffW(up_str.data(), static_cast<DWORD>(up_str.size())); return wstring(up_str.data(), up_str.size());}
开发者ID:landswellsong,项目名称:FAR,代码行数:6,
示例23: wstring const std::wstring wstring() const { return wstring(codecvt()); }
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:1,
|