本文整理汇总了C++中AddPath函数的典型用法代码示例。如果您正苦于以下问题:C++ AddPath函数的具体用法?C++ AddPath怎么用?C++ AddPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddPath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: PHYSFS_getLastModTime
void ZipArchiveImpl::AddFolder(const bfs::path& path, const bfs::path& archive_path)
{
++m_Info.folderCount;
zip_fileinfo fileinfo;
fileinfo.internal_fa = 0;
#ifdef _WIN32
fileinfo.external_fa = ::GetFileAttributesW(path.native().c_str());
#else
{
struct stat path_stat;
if (::stat(path.native().c_str(), &path_stat) == 0)
{
fileinfo.external_fa = path_stat.st_mode;
}
}
#endif
fileinfo.dosDate = 0;
// Read the time from the filesystem and convert it
auto fsTime = bfs::last_write_time(path);
auto posixTime = boost::posix_time::from_time_t(fsTime);
auto tm = boost::posix_time::to_tm(posixTime);
/* TODO: this is how to get the time for a physfs file
boost::posix_time::ptime posixTime;
auto milisPastEpoc = PHYSFS_getLastModTime(path.generic_string().c_str());
if (milisPastEpoc >= 0)
time = boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1), boost::posix_time::milliseconds(milisPastEpoc));
else
time = boost::posix_time::second_clock::local_time();
*/
fileinfo.tmz_date.tm_hour = tm.tm_hour;
fileinfo.tmz_date.tm_min = tm.tm_min;
fileinfo.tmz_date.tm_sec = tm.tm_sec;
fileinfo.tmz_date.tm_year = tm.tm_year;
fileinfo.tmz_date.tm_mon = tm.tm_mon;
fileinfo.tmz_date.tm_mday = tm.tm_mday;
auto r = zipOpenNewFileInZip(m_File, (archive_path.generic_string() + "/").c_str(),
&fileinfo,
nullptr, 0,
nullptr, 0,
nullptr,
Z_DEFLATED,
Z_BEST_SPEED);
zipCloseFileInZip(m_File);
for (bfs::directory_iterator it(path), end = bfs::directory_iterator(); it != end; ++it)
{
AddPath(it->path(), archive_path / it->path().filename());
}
}
开发者ID:Kezeali,项目名称:Fusion,代码行数:54,代码来源:FusionZipArchive.cpp
示例17: AddPath
FilePath& FilePath::operator+=(const String & path)
{
absolutePathname = AddPath(*this, path);
if (pathType == PATH_EMPTY)
{
pathType = GetPathType(absolutePathname);
}
return (*this);
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:11,代码来源:FilePath.cpp
示例18: pathname
FilePath FilePath::operator+(const String &path) const
{
FilePath pathname(AddPath(*this, path));
pathname.pathType = this->pathType;
if (this->pathType == PATH_EMPTY)
{
pathname.pathType = GetPathType(pathname.absolutePathname);
}
return pathname;
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:12,代码来源:FilePath.cpp
示例19: ForgetPath
//
// RequestPath
//
// Request a new path be found. Returns FALSE if request is invalid.
//
Finder::RequestResult Finder::RequestPath
(
U32 sx, U32 sz, U32 dx, U32 dz, U8 traction, UnitObj *unit,
SearchType type, U32 flags, PointList *blockList
)
{
// Forget any current path
ForgetPath();
// Is destination on the map
if (!WorldCtrl::CellOnMap(sx, sz) || !WorldCtrl::CellOnMap(dx, dz))
{
LOG_DIAG(("Request position is not on the map (%u, %u)->(%u,%u)", sx, sz, dx, dz));
return (RR_OFFMAP);
}
// Filter out requests to move to the same cell
if (sx == dx && sz == dz)
{
return (RR_SAMECELL);
}
// Can this traction type move to this cell
if (!CanMoveToCell(traction, dx, dz))
{
U32 xNew, zNew;
// Find the closest location we can move to
if (FindClosestCell(traction, dx, dz, xNew, zNew, 15))
{
// Use the new location
dx = xNew;
dz = zNew;
}
else
// AStar will fail, so jump straight to trace
if (type == ST_ASTAR)
{
type = ST_TRACE;
}
}
// Create a new path
path = new Path(sx, sz, dx, dz, traction, unit, type, flags, blockList);
// Add to the system
AddPath(path);
// Success
return (RR_SUBMITTED);
}
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:57,代码来源:pathsearch_finder.cpp
示例20: EnumerateFiles
BOOL CAddListDlg::EnumerateFiles()
{
m_AddFileCount=0;
BOOL success=TRUE;
// Recurse any directories in files list, placing enumerated files into
// the 'files' list
POSITION pos=m_pStrList->GetHeadPosition();
for( int i=0; pos != NULL && success; i++)
success=AddPath(&m_EnumeratedList, m_pStrList->GetNext(pos));
return success;
}
开发者ID:danieljennings,项目名称:p4win,代码行数:13,代码来源:AddListDlg.cpp
注:本文中的AddPath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论