当前位置: 首页>>代码示例>>C++>>正文


C++ ws2s函数代码示例

本文整理汇总了C++中ws2s函数的典型用法代码示例。如果您正苦于以下问题:C++ ws2s函数的具体用法?C++ ws2s怎么用?C++ ws2s使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ws2s函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tok1

void TransfersDialog::OnbtnAddTransferClick(wxCommandEvent& event)
{
    wxString wxstrId = TextCtrl1->GetValue();       // c
    wxString wxstrDescr = TextCtrl2->GetValue();    // consumption
    //string strId = string(TextCtrl2->GetValue().mb_str(wxConvISO8859_1));
    //string strDescr = string(TextCtrl1->GetValue().mb_str(wxConvISO8859_1));
    wxString wxstrFrom = ddFrom->GetString(ddFrom->GetCurrentSelection());
    wxStringTokenizer tok1(wxstrFrom, _("\t"));
    wxString wxstrFromShort = tok1.GetNextToken();
    wxString wxstrFromLong = tok1.GetNextToken();

    wxString wxstrTo = ddTo->GetString(ddTo->GetCurrentSelection());
    wxStringTokenizer tok2(wxstrTo, _("\t"));
    wxString wxstrToShort = tok2.GetNextToken();
    wxString wxstrToLong= tok2.GetNextToken();
    //wxString wxstrTo = ddTo->GetData(ddTo->GetCurrentSelection());

    string strVar = ws2s(wxstrId);
    string strDescr = ws2s(wxstrDescr);
    string strFrom = ws2s(wxstrFromShort);
    string strTo = ws2s(wxstrToShort);

    // USE CREATETRANSFER FUNCTION AND REMOVE CALL ON GETTRANSFERS

    createTransfer(wxstrToShort, wxstrFromShort, wxstrId, wxstrDescr);

    // Expression::makeToken(strVar); // moved to Transfer::create(...)

    populateList();
    TextCtrl1->Clear();
    TextCtrl2->Clear();
    TextCtrl1->SetFocus();
}
开发者ID:Obson,项目名称:SimX,代码行数:33,代码来源:TransfersDialog.cpp

示例2: s2ws

std::vector<std::string>* DataInDirectoryInvestigator::SearchFiles(std::string fileType){
	this->fileType = fileType;

	std::string searchQuery = dirPath;
	searchQuery.append(fileType);
	
	std::wstring stemp = s2ws(searchQuery);
	LPCWSTR DIRPATH = stemp.c_str();
	
	std::cout << "Searching Files in " << dirPath << std::endl;
	std::vector<std::string> * acquiredFilePaths = new std::vector<std::string>();

	HANDLE hFind;
	WIN32_FIND_DATA w32fd;
	hFind = FindFirstFile(DIRPATH, &w32fd);
	if( hFind != INVALID_HANDLE_VALUE){
		do {
			//std::cout << "cAlternateFileName : " << ws2s(w32fd.cAlternateFileName) << std::endl;
			//printf("ファイル名:%S\n", w32fd.cFileName);
			std::cout << "ファイル名: " << ws2s(w32fd.cFileName) << std::endl;
			acquiredFilePaths->push_back(ws2s(w32fd.cFileName));
		} while (FindNextFile (hFind, &w32fd));
		FindClose(hFind);
	}
	return acquiredFilePaths;
}
开发者ID:RozKen,项目名称:SATest,代码行数:26,代码来源:DataInDirectoryInvestigator.cpp

示例3: ws2s

Transfer *TransfersDialog::createTransfer(wxString &to, wxString &from, wxString &name, wxString &descr)
{
    string strVar = ws2s(name);
    string strDescr = ws2s(descr);
    string strFrom = ws2s(from);
    string strTo = ws2s(to);

    return Transfer::create(strTo, strFrom, strVar, strDescr);
}
开发者ID:Obson,项目名称:SimX,代码行数:9,代码来源:TransfersDialog.cpp

示例4: wWinMain

int WINAPI wWinMain(HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */, LPWSTR lpCmdLine, int /* nCmdShow */)
{
	LPWSTR* arg_list;
	int arg_num = 0;

    // Ignore the return value because we want to continue running even in the
    // unlikely event that HeapSetInformation fails.
    HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);

    if (SUCCEEDED(CoInitialize(NULL)))
    {
		App *app = new App();
		arg_list = CommandLineToArgvW(lpCmdLine, &arg_num);
		if (arg_num == 2)
		{
			CardData data;
			strcpy_s(data.username, ws2s(arg_list[0]).c_str());
			strcpy_s(data.password, ws2s(arg_list[1]).c_str());

			try
			{
				NFC_READER->Initialize();
				NFC_READER->Write(data);
				NFC_READER->Uninitialize();
			}
			catch (...)
			{
				MessageBox(NULL, L"שגיאה התרחשה בכתיבה לכרטיס או שלא נמצא כרטיס...", L"שים/י לב!", STDMSGBOX | MB_ICONWARNING);
				return 1;
			}
			return 0;
		}
        if (SUCCEEDED(app->Initialize()))
        {
			app->ChangeScreenTo(App::Screens::WaitingToCardScreen);
			MSG msg;
			memset(&msg, 0, sizeof(msg));
			while (app->AppMode != -1)
			{
				if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
				{
					TranslateMessage(&msg);
					DispatchMessage(&msg);
				}

				app->Update();
				app->Render();
			}
        }
		delete app;
        CoUninitialize();
    }
	
    return 0;
}
开发者ID:Three141,项目名称:PectoStudioNFC,代码行数:55,代码来源:Main.cpp

示例5: OpenPath

void CDlgController::OpenFile(const std::wstring& wstrFilename)
{
	if (IOReadBase::Exists(ws2s(wstrFilename)))
	{
		OpenPath(GetParentPath(wstrFilename),s2ws(CRenderNodeMgr::getInstance().getDataPlugsMgr().getAllExtensions()));
		//m_ListBoxFolder.SetSelec()
		//GetFilename(wstrFilename)
		CMainRoot::getInstance().getMainDialog().getModelDisplay().LoadModel(ws2s(wstrFilename));
		CMainRoot::getInstance().getMainDialog().getDlgModelController().OnUpdate();
	}
}
开发者ID:50059021,项目名称:wodegongjubao,代码行数:11,代码来源:DlgController.cpp

示例6: FindFirstFile

bool ZipResourceDepot::RegisterPackages(std::wstring basePackagePath)
{
	HANDLE fileHandle;
	WIN32_FIND_DATA findData;

	//Get first file
	std::wstring pathSpec = basePackagePath + L"*";
	fileHandle = FindFirstFile(pathSpec.c_str(), &findData);
	if (fileHandle != INVALID_HANDLE_VALUE)
	{
		//Loop on all remaining entries
		while (FindNextFile(fileHandle, &findData))
		{
			//Skip if file is hidden
			if (findData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
			{
				continue;
			}

			//Do not currently support packages within directories, so throw Warning
			if (findData.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY)
			{
				//Do not warn for directory symbol
				if (findData.cFileName != s2ws(".."))
				{
					BE_WARNING("Packages within Directories are ignored");
				}
			}
			else
			{
				std::wstring filename = findData.cFileName;
				std::wstring lowerPackageName = filename;

				std::transform(lowerPackageName.begin(), lowerPackageName.end(), lowerPackageName.begin(), (int(*)(int))std::tolower);
				lowerPackageName = lowerPackageName.substr(0, lowerPackageName.find_last_of('.'));

				pathSpec = pathSpec.substr(0, pathSpec.find_last_of('/'));
				pathSpec = pathSpec + s2ws("/") + filename;

				//Add Package to mapping
				m_packageMap[ws2s(lowerPackageName)] = PackageMappingDetails(m_numPackages, ws2s(pathSpec));
				m_numPackages++;
			}
		}
	}

	FindClose(fileHandle);


	return true;
}
开发者ID:jel-massih,项目名称:BombastEngine,代码行数:51,代码来源:ResourceDepot.cpp

示例7: OnCbnSelchangeComboSoure

void CProSetCameraTab::OnCbnSelchangeComboSoure()
{
	CString name;
	m_ComboSource.GetLBText(m_ComboSource.GetCurSel(),name);
	wstring wname = name;
	m_pConfigCenter->SetCameraName(ws2s(wname));
}
开发者ID:bblr001,项目名称:MVS,代码行数:7,代码来源:ProSetCameraTab.cpp

示例8: pStm

void OIBReader::ReadStream(POLE::Storage &pStg, wstring &stream_name)
{
	POLE::Stream pStm(&pStg,ws2s(stream_name));
	unsigned char *pbyData = 0;

	//open
	if (!pStm.eof() && !pStm.fail())
	{
		//get stream size
		size_t sz = pStm.size();
		//allocate 
		pbyData = new unsigned char[sz];
		if (!pbyData) return;
		//read
		if (pStm.read(pbyData,sz)) {
			//read oib info
			if (stream_name == wstring(L"OibInfo.txt")) {
				ReadOibInfo(pbyData, sz);
			} else {
				if (m_type==0 || (m_type==1 && m_oib_t==0))
					ReadOif(pbyData, sz);
			}
		}
	}

	//release
	if (pbyData)
		delete[] pbyData;
}
开发者ID:jefferis,项目名称:fluorender,代码行数:29,代码来源:oib_reader.cpp

示例9: _T

void CUpdateMgr::RestoreFile(wstring strRestorePath,wstring wsCurDirectory)
{
	CFileFind fileFinder;
	CString filePath ;//= strRestorePath.c_str() + _T("//*.*");
	filePath.Format(_T("%s\\*.*"),strRestorePath.c_str());
	BOOL bFinished = fileFinder.FindFile(filePath);
	wstring wsDestfile;
	wstring wsRestoreFile;
	while(bFinished)  //每次循环对应一个类别目录
	{
		bFinished = fileFinder.FindNextFile();
		if(fileFinder.IsDirectory() && !fileFinder.IsDots())  //若是目录则递归调用此方法
		{
			// BayesCategoryTest(bt, fileFinder.GetFilePath());
		}
		else  //再判断是否为txt文件
		{
			//获取文件类型
			CString fileName = fileFinder.GetFileName();
			if(fileName.Right(4).CompareNoCase(_T("_BAK")) == 0)
			{
				wsRestoreFile = strRestorePath + L"\\" + fileName.GetBuffer(0);
				wsDestfile = wsCurDirectory + L"\\" + fileName.Left(fileName.GetLength()-4).GetBuffer(0);
				BOOL bret = CsysFile::Copy(wsRestoreFile,wsDestfile);
				if (FALSE == bret)
				{
					g_Logger.Error(__FILE__,__LINE__,"还原文件失败 restore %s to %s",ws2s(wsRestoreFile).c_str(),ws2s(wsDestfile).c_str());
				}
			}
		}
	}
}
开发者ID:charlessoft,项目名称:updateproject,代码行数:32,代码来源:UpdateMgr.cpp

示例10: ws2s

//----------------------------------------------------------------
void CPUTConfigEntry::ValueAsFloatArray(float *pFloats, int count)
{
//    char *szOrigValue = new char [szValue.length()+1];
//FIXME memory leak here
	char *pString = ws2s(szValue.c_str());
    //strcpy(szOrigValue, pString);

	char *szNewValue = NULL;
    char *szCurrValue = strtok_r(pString, " ", &szNewValue);
    for(int clear = 0; clear < count; clear++)
    {
        pFloats[clear] = 0.0f;
    }
    for(int ii=0;ii<count;++ii)
    {
        if(szCurrValue == NULL)
        {
			delete pString;
            return;
        }
        pFloats[ii] = (float) atof(szCurrValue);
        szCurrValue = strtok_r(NULL, " ", &szNewValue);

    }
    
    //delete szOrigValue;
	delete[] pString;
}
开发者ID:Cristianohh,项目名称:InstancingAndroid,代码行数:29,代码来源:CPUTConfigBlock.cpp

示例11: ws2s

string ProcessList::getNameByProcessId(DWORD pid) {
	for (map<DWORD, wstring>::iterator it = cachedProcessList.begin(); it != cachedProcessList.end(); it++) {
		if (it->first == pid) {
			return ws2s(it->second).c_str();
		}
	}
	return "";
}
开发者ID:begner,项目名称:CUELegendKeys,代码行数:8,代码来源:ProcessList.cpp

示例12: IniGetStr

void CDlgUIList::OnDlgListBoxDblClk()
{
	if (m_ListBox.GetSelectedItem())
	{
		std::string strEditUIFilename = IniGetStr("UIEditorUI.cfg","UIConfig","edit");
		createDialogCodeFromXML(strEditUIFilename,ws2s(m_ListBox.GetSelectedItem()->wstrText));
	}
}
开发者ID:constantinbogdan,项目名称:node3d,代码行数:8,代码来源:DlgUIList.cpp

示例13: ws2s

// buffer pointed to by pOut must be large enough for data
bool CommandParser::GetParameter(cString arg, char *pOut)
{
	std::map<cString, cString>::iterator it;
	std::stringstream ss;

	it = m_ArgumentMap.find(arg);
	if (it == m_ArgumentMap.end())
		return false;

#ifdef 	CPUT_OS_ANDROID
    ss << ws2s(it->second.c_str());
#else
    ss << ws2s(it->second);
#endif
	ss >> pOut;

	return true;
}
开发者ID:Cristianohh,项目名称:InstancingAndroid,代码行数:19,代码来源:CPUTParser.cpp

示例14: ReadMacrosFromConfigBlock

//-----------------------------------------------------------------------------
void ReadMacrosFromConfigBlock(
    CPUTConfigBlock   *pMacrosBlock,
    CPUT_SHADER_MACRO  *pShaderMacros,
    CPUT_SHADER_MACRO **pUserSpecifiedMacros,
    int               *pNumUserSpecifiedMacros,
    CPUT_SHADER_MACRO **pFinalShaderMacros
    ){
        *pNumUserSpecifiedMacros = pMacrosBlock->ValueCount();

        // Count the number of macros passed in
        CPUT_SHADER_MACRO *pMacro = (CPUT_SHADER_MACRO*)pShaderMacros;
        int numPassedInMacros = 0;
        if( pMacro )
        {
            while( pMacro->Name )
            {
                ++numPassedInMacros;
                ++pMacro;
            }
        }

        // Allocate an array of macro pointer large enough to contain the passed-in macros plus those specified in the .mtl file.
        *pFinalShaderMacros = new CPUT_SHADER_MACRO[*pNumUserSpecifiedMacros + numPassedInMacros + 1];

        // Copy the passed-in macro pointers to the final array
        int jj;
        for( jj=0; jj<numPassedInMacros; jj++ )
        {
            (*pFinalShaderMacros)[jj] = *(CPUT_SHADER_MACRO*)&pShaderMacros[jj];
        }

        // Create a CPUT_SHADER_MACRO for each of the macros specified in the .mtl file.
        // And, add their pointers to the final array
        *pUserSpecifiedMacros = new CPUT_SHADER_MACRO[*pNumUserSpecifiedMacros];
        for( int kk=0; kk<*pNumUserSpecifiedMacros; kk++, jj++ )
        {
            CPUTConfigEntry *pValue   = pMacrosBlock->GetValue(kk);
            (*pUserSpecifiedMacros)[kk].Name       = ws2s(pValue->NameAsString());
            (*pUserSpecifiedMacros)[kk].Definition = ws2s(pValue->ValueAsString());
            (*pFinalShaderMacros)[jj] = (*pUserSpecifiedMacros)[kk];
        }
        (*pFinalShaderMacros)[jj].Name = NULL;
        (*pFinalShaderMacros)[jj].Definition = NULL;
}
开发者ID:Cristianohh,项目名称:InstancingAndroid,代码行数:45,代码来源:CPUTMaterial.cpp

示例15:

vector<string> &RunDialog::getCheckedItems()
{
    int nItems = CheckListBox1->GetCount();
    for (int i = 0; i < nItems; i++) {
        if (CheckListBox1->IsChecked(i)) {
            checkedItems.push_back(ws2s(CheckListBox1->GetString(i)));
        }
    }
    return checkedItems;
}
开发者ID:Obson,项目名称:SimX,代码行数:10,代码来源:RunDialog.cpp


注:本文中的ws2s函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。