本文整理汇总了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;
}
示例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("");
}
示例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);
}
示例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));
}
示例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;
}
}
示例6: DVASSERT
FilePath::FilePath(const FilePath &directory, const String &filename)
{
DVASSERT(directory.IsDirectoryPathname());
pathType = directory.pathType;
absolutePathname = AddPath(directory, filename);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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());
}
示例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
}
示例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);
}
}