本文整理汇总了C++中PathList类的典型用法代码示例。如果您正苦于以下问题:C++ PathList类的具体用法?C++ PathList怎么用?C++ PathList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PathList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCreateFileEditPosHistory
bool GetCreateFileEditPosHistory( clPtr<FS>* Fs, FSPath* Path, sEditorScrollCtx& Ctx )
{
if ( !g_WcmConfig.editSavePos || !Fs || !Fs->Ptr() || !Path )
{
return false;
}
std::vector<unicode_t> Name = new_unicode_str( (*Fs)->Uri( *Path ).GetUnicode() );
// check if item already exists in the list
const int Index = g_ViewList.FindByName( Name.data() );
if ( Index != -1 )
{
StrConfig* Cfg = g_ViewList.GetData( Index )->conf.ptr();
Ctx.m_FirstLine = Cfg->GetIntVal( EDIT_FIRST_LINE );
Ctx.m_Point.line = Cfg->GetIntVal( EDIT_POINT_LINE );
Ctx.m_Point.pos = Cfg->GetIntVal( EDIT_POINT_POS );
return true;
}
// collect all needed path information
PathList::Data Data;
if ( PathListFSToData( Data, Fs, Path ) )
{
AddFileEditToHistory( Index, Data, 0, 0, 0 );
}
return false;
}
示例2: GetCreateFileViewPosHistory
int GetCreateFileViewPosHistory( clPtr<FS>* Fs, FSPath* Path )
{
if ( !g_WcmConfig.editSavePos || !Fs || !Fs->Ptr() || !Path )
{
return -1;
}
std::vector<unicode_t> Name = new_unicode_str( (*Fs)->Uri( *Path ).GetUnicode() );
// check if item already exists in the list
const int Index = g_ViewList.FindByName( Name.data() );
if ( Index != -1 )
{
StrConfig* Cfg = g_ViewList.GetData( Index )->conf.ptr();
return Cfg->GetIntVal( VIEW_POS );
}
// collect all needed path information
PathList::Data Data;
if ( PathListFSToData( Data, Fs, Path ) )
{
AddFileViewToHistory( -1, Data, 0 );
}
return 0;
}
示例3: printPathList
void Conn::printPathList(PathList& paths, Fleet::Ptr _fleet)
{
// cout << "\n\nPrinting path list \n\n";
while(!paths.empty())
{
Cost cost(0);
Time time(0);
bool exp = true;
Path p = paths.front();
Path::iterator it = p.begin();
for(; it != p.end(); it++)
{
Segment* seg = *it;
cost = cost + seg->cost(_fleet);
time = time + seg->time(_fleet);
if(!seg->expediteSupport()) exp = false;
}
cout << cost.string() << " " << time.string() << " " << (exp?"yes; ":"no; ");
Conn::printPath(paths.front());
cout << "\n";
paths.pop();
}
}
示例4: getChildren
bool Path::getChildren(PathList& children) const
{
#if WENDY_SYSTEM_WIN32
WIN32_FIND_DATA data;
HANDLE search;
search = FindFirstFile(path.c_str(), &data);
if (search == INVALID_HANDLE_VALUE)
return false;
do
{
children.push_back(operator + (data.cFileName));
}
while (FindNextFile(search, &data));
FindClose(search);
#else
DIR* stream;
dirent* entry;
stream = opendir(path.c_str());
if (!stream)
return false;
while ((entry = readdir(stream)))
children.push_back(operator + (entry->d_name));
closedir(stream);
#endif
return true;
}
示例5: AddFolderToHistory
void AddFolderToHistory( clPtr<FS>* fs, FSPath* path )
{
if ( fs && fs->Ptr() && path )
{
// collect all needed path information
PathList::Data data;
if ( PathListFSToData( data, fs, path ) )
{
// check if item already exists in the list
const int index = g_dataList.FindByName( data.name.data() );
if ( index != -1 )
{
// remove existing item
g_dataList.Remove( index );
}
// add item to the and of the list
g_dataList.Add( data.name.data(), data.conf );
// limit number of elements in the list
while ( g_dataList.GetCount() > MAX_FOLDERS_HISTORY_COUNT )
{
g_dataList.Remove( 0 );
}
}
}
}
示例6: FindFirstFile
PathList Path::children() const
{
PathList children;
#if WENDY_SYSTEM_WIN32
WIN32_FIND_DATA data;
HANDLE search;
search = FindFirstFile(m_string.c_str(), &data);
if (search == INVALID_HANDLE_VALUE)
return PathList();
do
{
children.push_back(operator + (data.cFileName));
}
while (FindNextFile(search, &data));
FindClose(search);
#else
DIR* stream;
dirent* entry;
stream = opendir(m_string.c_str());
if (!stream)
return PathList();
while ((entry = readdir(stream)))
children.push_back(operator + (entry->d_name));
closedir(stream);
#endif
return children;
}
示例7: listDir
size_t Path::listDir(PathList &l, bool recurse, unsigned short flags) const {
EachFunc func;
details::DirLister dl(l);
Bind(&dl, &details::DirLister::dirItem, func);
l.clear();
each(func, recurse, flags);
return l.size();
}
示例8: removeGridPath
void DataManager::removeGridPath(int x, int y, PathVect* path) {
PathList* objects = &GET_GRID_ITEM(grid,x,y).paths;
for (PathList::iterator it = objects->begin(); it != objects->end(); it++) {
if ((*it).second == path) {
objects->erase(it);
break;
}
}
}
示例9:
/* static private */
void
SharedPathsOp::clearEdges(PathList& edges)
{
for (PathList::const_iterator
i=edges.begin(), e=edges.end();
i!=e; ++i)
{
delete *i;
}
edges.clear();
}
示例10: xpath
Container::PathList Container::PackageLocations() const
{
XPathWrangler xpath(_ocf, {{"ocf", "urn:oasis:names:tc:opendocument:xmlns:container"}});
PathList output;
for ( string& str : xpath.Strings(gRootfilePathsXPath) )
{
output.emplace_back(std::move(str));
}
return output;
}
示例11: findLinearIntersections
/* public */
void
SharedPathsOp::getSharedPaths(PathList& forwDir, PathList& backDir)
{
PathList paths;
findLinearIntersections(paths);
for (size_t i=0, n=paths.size(); i<n; ++i)
{
LineString* path = paths[i];
if ( isSameDirection(*path) ) forwDir.push_back(path);
else backDir.push_back(path);
}
}
示例12: find_sys_include
string find_sys_include(string includeName)
{
for(PathList::const_iterator i = includePaths.begin(); i != includePaths.end(); i++)
{
string path = *i + includeName;
std::ifstream test(path.c_str(), std::ifstream::in);
bool found = test.is_open();
test.close();
if(found) return *i;
}
return includeName;
}
示例13: SearchPathList
PathName PathName::SearchPathList(const PathList &pathList) const {
PathName fullFileName;
for (PathList::const_iterator i = pathList.begin(); i != pathList.end(); ++i) {
fullFileName = *i;
fullFileName.Append(*this);
if (fullFileName.IsFile())
return fullFileName;
}
return fullFileName;
}
示例14: add_to_vector
// helps fill in the path matrix (see below)
void add_to_vector (PathList& previous_vector, wstring* to_add) {
wstring string_rep = represent_path (to_add, 2);
if (previous_vector.size() == 0) {
previous_vector.push_back (string_rep);
}
else {
PathList::iterator it;
// if there is more than one possible path, add to all of them
for (it=previous_vector.begin(); it != previous_vector.end(); it++) {
it->append (string_rep);
}
}
}
示例15: path
void Path::fillBinaryPackagesList(std::vector<std::string>& pkglist)
{
std::string header = "Packages from: ";
header += path().getBinaryPackagesDir();
pkglist.clear();
pkglist.push_back(header);
PathList pkgs = path().getBinaryPackages();
std::sort(pkgs.begin(), pkgs.end());
PathList::const_iterator itb = pkgs.begin();
PathList::const_iterator ite = pkgs.end();
for (; itb!=ite; itb++){
pkglist.push_back(*itb);
}
return;
}