當前位置: 首頁>>代碼示例>>C++>>正文


C++ AddPath函數代碼示例

本文整理匯總了C++中AddPath函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddPath函數的具體用法?C++ AddPath怎麽用?C++ AddPath使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AddPath函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: LOG

// Called before render is available
bool j1FileSystem::Awake(pugi::xml_node& config)
{
	LOG("Loading File System");
	bool ret = true;

	// Add all paths in configuration in order
	for(pugi::xml_node path = config.child("path"); path; path = path.next_sibling("path"))
	{
		AddPath(path.child_value());
	}

	// Ask SDL for a write dir
	char* write_path = SDL_GetPrefPath(App->GetOrganization(), App->GetTitle());

	if(PHYSFS_setWriteDir(write_path) == 0)
		LOG("File System error while creating write dir: %s\n", PHYSFS_getLastError());
	else
	{
		// We add the writing directory as a reading directory too with speacial mount point
		LOG("Writing directory is %s\n", write_path);
		AddPath(write_path, GetSaveDirectory());
	}

	SDL_free(write_path);

	return ret;
}
開發者ID:kellazo,項目名稱:GameDevelopment,代碼行數:28,代碼來源:j1FileSystem.cpp

示例2: FindIncludeFile

CString FindIncludeFile( const TCHAR *pszIncludeFilename, const TCHAR *pszIncludePath )
{
	CString strEnvInclude;
	CStringList strrgPathList;
	
	if( FileExists( pszIncludeFilename ) )
		return CString(pszIncludeFilename);
	
	// add current directory to path list;
	strrgPathList.AddTail( ".\\" );
	
	// add path specified in the command line (/I option)
	if( pszIncludePath )
		AddPath( strrgPathList, pszIncludePath );
	
	// add path specified in the INCLUDE variable
	if( strEnvInclude.GetEnvironmentVariable( _T("INCLUDE") ) )
		AddPath( strrgPathList, strEnvInclude );
	
	POSITION pos = strrgPathList.GetHeadPosition();
	for (int i=0;i < strrgPathList.GetCount();i++)
	{
		CString strPath = strrgPathList.GetNext(pos);
		CString tmp = strPath.Right(1);
		if( tmp != ":" && tmp != "\\" )
			strPath += '\\';
		
		strPath += pszIncludeFilename;
		
		if( FileExists( strPath ) )
			return CString(strPath);
	}

	return CString("");
}
開發者ID:dbremner,項目名稱:VC2010Samples,代碼行數:35,代碼來源:makehm.cpp

示例3: j1Module

j1FileSystem::j1FileSystem(const char* game_path) : j1Module()
{
	name.create("file_system");

	// need to be created before Awake so other modules can use it
	char* base_path = SDL_GetBasePath();
	PHYSFS_init(base_path);
	SDL_free(base_path);

	AddPath(".");
	AddPath(game_path);
}
開發者ID:Pau5erra,項目名稱:XML,代碼行數:12,代碼來源:j1FileSystem.cpp

示例4: it

void QtStylePreferencePage::Update()
{
  styleManager->RemoveStyles();

  QString paths = m_StylePref->Get(berry::QtPreferences::QT_STYLE_SEARCHPATHS, "");
  QStringList pathList = paths.split(";", QString::SkipEmptyParts);
  QStringListIterator it(pathList);
  while (it.hasNext())
  {
    AddPath(it.next(), false);
  }

  QString styleName = m_StylePref->Get(berry::QtPreferences::QT_STYLE_NAME, "");
  styleManager->SetStyle(styleName);
  oldStyle = styleManager->GetStyle();
  FillStyleCombo(oldStyle);

  QString fontName = m_StylePref->Get(berry::QtPreferences::QT_FONT_NAME, "Open Sans");
  styleManager->SetFont(fontName);

  int fontSize = m_StylePref->Get(berry::QtPreferences::QT_FONT_SIZE, "9").toInt();
  styleManager->SetFontSize(fontSize);
  controls.m_FontSizeSpinBox->setValue(fontSize);
  styleManager->UpdateWorkbenchFont();

  FillFontCombo(styleManager->GetFont());

  controls.m_ToolbarCategoryCheckBox->setChecked(
    m_StylePref->GetBool(berry::QtPreferences::QT_SHOW_TOOLBAR_CATEGORY_NAMES, true));
}
開發者ID:Cdebus,項目名稱:MITK,代碼行數:30,代碼來源:berryQtStylePreferencePage.cpp

示例5: switch

void CRegisterDlg::OnReceiveComplete(void)
{

	switch (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[0])
	{

	case TOKEN_REG_PATH:
		{

			AddPath((char*)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1)));
			break;
		}

	case TOKEN_REG_KEY:
		{

			AddKey((char*)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1)));
			break;
		}

	default:
		// 傳輸發生異常數據
		break;

	}
}
開發者ID:zibility,項目名稱:Remote,代碼行數:26,代碼來源:RegisterDlg.cpp

示例6: DVASSERT

FilePath::FilePath(const FilePath &directory, const String &filename)
{
	DVASSERT(directory.IsDirectoryPathname());

    pathType = directory.pathType;
	absolutePathname = AddPath(directory, filename);
}
開發者ID:droidenko,項目名稱:dava.framework,代碼行數:7,代碼來源:FilePath.cpp

示例7: Clear

bool CTSVNPathList::LoadFromFile(const CTSVNPath& filename)
{
    Clear();
    try
    {
        CString strLine;
        CStdioFile file(filename.GetWinPath(), CFile::typeBinary | CFile::modeRead | CFile::shareDenyWrite);

        // for every selected file/folder
        CTSVNPath path;
        while (file.ReadString(strLine))
        {
            path.SetFromUnknown(strLine);
            AddPath(path);
        }
        file.Close();
    }
    catch (CFileException* pE)
    {
        std::unique_ptr<TCHAR[]> error(new TCHAR[10000]);
        pE->GetErrorMessage(error.get(), 10000);
        ::MessageBox(NULL, error.get(), L"TortoiseSVN", MB_ICONERROR);
        pE->Delete();
        return false;
    }
    return true;
}
開發者ID:yuexiaoyun,項目名稱:tortoisesvn,代碼行數:27,代碼來源:TSVNPath.cpp

示例8: Clear

bool CTGitPathList::LoadFromFile(const CTGitPath& filename)
{
	Clear();
	try
	{
		CString strLine;
		CStdioFile file(filename.GetWinPath(), CFile::typeBinary | CFile::modeRead | CFile::shareDenyWrite);

		// for every selected file/folder
		CTGitPath path;
		while (file.ReadString(strLine))
		{
			path.SetFromUnknown(strLine);
			AddPath(path);
		}
		file.Close();
	}
	catch (CFileException* pE)
	{
		CTraceToOutputDebugString::Instance()(__FUNCTION__ ": CFileException loading target file list\n");
		TCHAR error[10000] = {0};
		pE->GetErrorMessage(error, 10000);
//		CMessageBox::Show(NULL, error, _T("TortoiseGit"), MB_ICONERROR);
		pE->Delete();
		return false;
	}
	return true;
}
開發者ID:KristinaTaylor,項目名稱:TortoiseSI,代碼行數:28,代碼來源:TGitPath.cpp

示例9: _T

int CTGitPathList::FillUnRev(unsigned int action, CTGitPathList *list, CString *err)
{
	this->Clear();
	CTGitPath path;

	int count;
	if(list==NULL)
		count=1;
	else
		count=list->GetCount();
	for (int i = 0; i < count; ++i)
	{
		CString cmd;
		int pos = 0;

		CString ignored;
		if(action & CTGitPath::LOGACTIONS_IGNORE)
			ignored= _T(" -i");

		if(list==NULL)
		{
			cmd=_T("git.exe ls-files --exclude-standard --full-name --others -z");
			cmd+=ignored;

		}
		else
		{	cmd.Format(_T("git.exe ls-files --exclude-standard --full-name --others -z%s -- \"%s\""),
					(LPCTSTR)ignored,
					(*list)[i].GetWinPath());
		}

		BYTE_VECTOR out, errb;
		out.clear();
		if (g_Git.Run(cmd, &out, &errb))
		{
			if (err != nullptr)
				CGit::StringAppend(err, &errb[0], CP_UTF8, (int)errb.size());
			return -1;
		}

		pos=0;
		CString one;
		while (pos >= 0 && pos < (int)out.size())
		{
			one.Empty();
			CGit::StringAppend(&one, &out[pos], CP_UTF8);
			if(!one.IsEmpty())
			{
				//SetFromGit will clear all status
				path.SetFromGit(one);
				path.m_Action=action;
				AddPath(path);
			}
			pos=out.findNextString(pos);
		}

	}
	return 0;
}
開發者ID:iamduyu,項目名稱:TortoiseGit,代碼行數:59,代碼來源:TGitPath.cpp

示例10: AddPath

FX_BOOL CFX_LinuxFontInfo::ParseFontCfg(const char** pUserPaths) {
  if (!pUserPaths) {
    return FALSE;
  }
  for (const char** pPath = pUserPaths; *pPath; ++pPath) {
    AddPath(*pPath);
  }
  return TRUE;
}
開發者ID:JinAirsOs,項目名稱:pdfium,代碼行數:9,代碼來源:fx_ge_linux.cpp

示例11: directoryPath

FilePath::FilePath(const String &directory, const String &filename)
{
	FilePath directoryPath(directory);
	DVASSERT(!directoryPath.IsEmpty());
	directoryPath.MakeDirectoryPathname();

    pathType = directoryPath.pathType;
	absolutePathname = AddPath(directoryPath, filename);
}
開發者ID:droidenko,項目名稱:dava.framework,代碼行數:9,代碼來源:FilePath.cpp

示例12: AddPath

bool Clipper::addPolyline(const ofPolyline& polyline,
                          ClipperLib::PolyType PolyTyp,
                          bool autoClose,
                          ClipperLib::cInt scale)
{
    auto _polyline = polyline;
    if (autoClose) close(_polyline);
    return AddPath(toClipper(_polyline, scale), PolyTyp, _polyline.isClosed());
}
開發者ID:bakercp,項目名稱:ofxClipper,代碼行數:9,代碼來源:Clipper.cpp

示例13: STATUS_LOG

void
SCSIPressurePathManager::ActivatePath ( IOSCSIProtocolServices * interface )
{
	
	bool					result 	= false;
	SCSITargetDevicePath *	path	= NULL;
	
	STATUS_LOG ( ( "SCSIPressurePathManager::ActivatePath\n" ) );
	
	require_nonzero ( interface, ErrorExit );
	
	IOLockLock ( fLock );
	
	result = fInactivePathSet->member ( interface );
	if ( result == true )
	{
		
		path = fInactivePathSet->getObjectWithInterface ( interface );
		if ( path != NULL )
		{
			
			path->retain ( );
			path->Activate ( );
			fInactivePathSet->removeObject ( interface );
			fPathSet->setObject ( path );
			path->release ( );
			path = NULL;
			
		}
		
	}
	
	else
	{
		
		result = fPathSet->member ( interface );
		if ( result == false )
		{
			
			IOLockUnlock ( fLock );
			AddPath ( interface );
			goto Exit;
			
		}
		
	}
	
	IOLockUnlock ( fLock );
	
	
ErrorExit:
Exit:
	
	
	return;
	
}
開發者ID:unofficial-opensource-apple,項目名稱:IOSCSIArchitectureModelFamily,代碼行數:57,代碼來源:SCSIPathManagers.cpp

示例14: PyInit

void PyInit(const TStr& PySettings)
{
	Try
	ifstream f(PySettings.CStr());
	if (f.is_open())
	{
		std::string s;
		std::getline(f, s);
		Py_Initialize(); // инициализация интерпретатора  */
		AddPath(s);
		AddPath(s+"\\\\networkx\\\\generators");
		AddPath(s+"\\\\networkx\\\\readwrite");
		AddPath(s+"\\\\networkx\\\\classes");
	}
	return;		
	IAssert(1);
	Catch
	
}
開發者ID:kbochenina,項目名稱:Snap,代碼行數:19,代碼來源:GenPy.cpp

示例15: GetEnv

//reads envvar, splits it by : and ; and add it to pathlist, when exists
static void GetEnv(const std::string& name, LSL::StringVector& pathlist)
{
	const char* envvar = getenv(name.c_str());
	if (envvar == NULL)
		return;
	LSL::StringVector res = LSL::Util::StringTokenize(envvar, ";:");
	for (const std::string path : res) {
		AddPath(path, pathlist);
	}
}
開發者ID:cleanrock,項目名稱:pr-downloader,代碼行數:11,代碼來源:springbundle.cpp


注:本文中的AddPath函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。