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


C++ FSString类代码示例

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


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

示例1: ParzeLink

bool ParzeLink( FSPath& path, FSString& link )
{
	FSPath t( link );

	if ( !path.IsAbsolute() && !t.IsAbsolute() ) { return false; } //не абсолютный путь

	int first = 0;

	if ( t.IsAbsolute() )
	{
		path.Clear();
		path.PushStr( FSString( "" ) );
		first = 1;
	}

	for ( int i = first; i < t.Count(); i++ )
	{
		FSString p = *( t.GetItem( i ) );

		if ( p.IsDot() ) { continue; }

		if ( p.Is2Dot() )
		{
			if ( path.Count() > 1 ) { path.Pop(); }
		}
		else
		{
			path.PushStr( p );
		}
	}

	return true;
}
开发者ID:KonstantinKuklin,项目名称:WalCommander,代码行数:33,代码来源:vfs.cpp

示例2: FSGetApplPath

bool FSGetApplPath(FSString &applPath, bool withPS/* = true*/)
{
 #if defined(WIN32) || defined(_WIN32_WCE)

	char    Temp[_MAX_PATH+1];
	::GetModuleFileNameA(NULL, Temp, _MAX_PATH);

	applPath = Temp;

	STRIndex_t pos = applPath.FindRAt(PATH_SEPARATOR_CHAR);
	if ( STRING_FOUND(pos) )
		applPath.Truncate( withPS ? pos + 1 : pos );

	return true;

#else

	UniString uniString;
	if ( FSGetApplPath(uniString, withPS) )
	{
		applPath = uniString;
	}

	return false;

#endif
}
开发者ID:kjoon010,项目名称:IncubeTech-Contribs,代码行数:27,代码来源:FileSystem.cpp

示例3: ArchGetParentDir

FSArchNode* ArchGetParentDir( FSArchNode* CurrDir, FSPath& ItemPath, const FSStat& ItemStat )
{
	for ( int i = 0; i < ItemPath.Count() - 1; i++ )
	{
		FSString* Name = ItemPath.GetItem( i );

		if ( i == 0 && ( Name->IsDot() || Name->IsEmpty() ) )
		{
			// skip root dir
			continue;
		}

		FSArchNode* Dir = CurrDir->findByName( *Name );

		if ( Dir == nullptr )
		{
			FSStat Stat = ItemStat;
			Stat.mode = S_IFDIR;
			Stat.size = 0;
			Dir = CurrDir->Add( FSArchNode( Name->GetUtf8(), Stat ) );
		}

		CurrDir = Dir;
	}

	return CurrDir;
}
开发者ID:corporateshark,项目名称:WCMCommander,代码行数:27,代码来源:plugin-archive.cpp

示例4: findByFsPath

FSTmpNode* FSTmpNode::findByFsPath(FSPath* fsPath, int fsPathLevel)
{
	FSString* curName = fsPath->GetItem(fsPathLevel);
	if (parentDir == 0 && fsPathLevel == fsPath->Count()-1 && (curName == 0 || curName->GetUnicode() == 0 || curName->GetUnicode()[0] == 0)) // request to find root node, and we are root
		return this;

	if (name.Cmp(*curName) == 0)
	{
		if (fsPath->Count() <= fsPathLevel)
		{   // exact match
			return this;
		}
		else
		{
			FSString* childName = fsPath->GetItem(fsPathLevel + 1);
			FSTmpNode* n = findByName(childName, false);
			if (n == 0)
				return 0;
			if (fsPath->Count() <= fsPathLevel + 2) // no further recursion
				return n;
			else if (n->nodeType == NODE_DIR) // recurse into subdir
				return n->findByFsPath(fsPath, fsPathLevel + 1);
			else
				return 0;
		}
	}
	else
		return 0;
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:29,代码来源:vfs-tmp.cpp

示例5: StrError

FSString FSSys::StrError( int err )
{
	sys_char_t buf[1024];
	FSString ret;
	ret.SetSys( sys_error_str( err, buf, 0x100 ) );
	return ret;
}
开发者ID:KonstantinKuklin,项目名称:WalCommander,代码行数:7,代码来源:vfs.cpp

示例6: Copy

void FSPath::Copy( const FSPath& a )
{
	cacheCs = -2;
	data.clear();

	for ( int i = 0 ; i < a.Count(); i++ )
	{
		FSString s;
		s.Copy( a.data.const_item( i ) );
		data.append( s );
	}
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:12,代码来源:vfspath.cpp

示例7: FSString

FSString FSWin32Net::StrError( int err )
{
	if ( err == ERRNOSUPPORT )
	{
		return FSString( "Operation not supported by net fs" );
	}

	FSString ret;
	sys_char_t buf[1024];
	ret.SetSys( sys_error_str( err, buf, 0x100 ) );

	return ret;
}
开发者ID:KonstantinKuklin,项目名称:WalCommander,代码行数:13,代码来源:vfs.cpp

示例8: stripPathFromLastItem

static void stripPathFromLastItem(FSPath& path)
{
	FSString* lastItem = path.GetItem(path.Count() - 1);
	if (lastItem)
	{
		const unicode_t* lastU = lastItem->GetUnicode();
		const unicode_t* lastDelim = unicode_strrchr(lastU, DIR_SPLITTER);
		if (lastDelim != 0)
		{
			path.SetItemStr(path.Count() - 1,FSString(lastDelim + 1));
		}
	}
}
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:13,代码来源:fileopers.cpp

示例9: SetItemStr

void FSPath::SetItemStr( int n, const FSString& str ) // n>=0 && n<=Count(); если n == Count то в конец добавляется еще один элемент
{
	if ( n < 0 || n > Count() ) { return; }

	cacheCs = -2;

	//чтоб не сработал эффект cptr
	FSString s;
	s.Copy( str );

	if ( n == Count() ) { data.append( s ); }
	else { data[n] = s; }
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:13,代码来源:vfspath.cpp

示例10: dbg_printf

FSArchNode* FSArchNode::findByName( const FSString& name, bool isRecursive )
{
	dbg_printf( "FSArchNodeDir::findByName name=%s\n", name.GetUtf8() );

	// first, try all nodes in current
	for ( FSArchNode& n : content )
	{
		dbg_printf( "FSArchNodeDir::findByName n.name=%s\n", n.name.GetUtf8() );

		if ( n.name.Cmp( ( FSString& ) name ) == 0 )
		{
			return &n;
		}
	}

	// only if not found in current dir, try inside subdirs
	if ( isRecursive )
	{
		for ( FSArchNode& n : content )
		{
			if ( n.IsDir() )
			{
				FSArchNode* pn = n.findByName( name, isRecursive );

				if ( pn )
				{
					return pn;
				}
			}
		}
	}

	return nullptr;
}
开发者ID:corporateshark,项目名称:WCMCommander,代码行数:34,代码来源:plugin-archive.cpp

示例11: Cmp

int FSString::Cmp( FSString& a )
{
	if ( !_primary.str() ) { return ( !a._primary.str() ) ? 0 : -1; }

	if ( !a._primary.str() ) { return 1; }

	return CmpStr<const unicode_t>( GetUnicode(), a.GetUnicode() );
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:8,代码来源:vfspath.cpp

示例12: findByFsPath

FSArchNode* FSArchNode::findByFsPath( FSPath& fsPath, int fsPathLevel )
{
	FSString* curName = fsPath.GetItem( fsPathLevel );

	if ( parentDir == nullptr
	     && fsPathLevel == fsPath.Count() - 1
	     && ( curName == nullptr || curName->GetUnicode() == 0 || curName->GetUnicode()[0] == 0 ) )
	{
		// request to find root node, and we are root
		return this;
	}

	if ( name.Cmp( *curName ) == 0 )
	{
		if ( fsPath.Count() <= fsPathLevel )
		{
			// exact match
			return this;
		}

		FSString* childName = fsPath.GetItem( fsPathLevel + 1 );
		FSArchNode* n = findByName( *childName );

		if ( n == nullptr )
		{
			return nullptr;
		}

		if ( fsPath.Count() <= fsPathLevel + 2 )
		{
			// no further recursion
			return n;
		}

		if ( n->IsDir() )
		{
			// recurse into subdir
			return n->findByFsPath( fsPath, fsPathLevel + 1 );
		}
	}

	return nullptr;
}
开发者ID:corporateshark,项目名称:WCMCommander,代码行数:43,代码来源:plugin-archive.cpp

示例13: Symlink

int FSSys::Symlink( FSPath& path, FSString& str, int* err, FSCInfo* info )
{
	if ( symlink( ( char* )str.Get( sys_charset_id ), ( char* )path.GetString( sys_charset_id ) ) )
	{
		SetError( err, errno );
		return -1;
	}

	return 0;
}
开发者ID:KonstantinKuklin,项目名称:WalCommander,代码行数:10,代码来源:vfs.cpp

示例14: FSValue

    FSString::FSString(const FSString& rhs) : FSValue(rhs), buffer(0), strLength(0), bufferLength(0)
    {
        strLength = rhs.length();
        bufferLength = strLength + 1;
        buffer = new char[bufferLength];

        if (bufferLength > 0 && buffer == 0)
            throw FSAllocationException("Cannot allocate memory to copy an FSString.");

        strcpy(buffer, rhs.buffer);
    }
开发者ID:ozkanpakdil,项目名称:f4l,代码行数:11,代码来源:FSString.cpp

示例15: OpenHomeDir

void OpenHomeDir( PanelWin* p )
{
#ifdef _WIN32
	std::vector<unicode_t> homeUri = GetHomeUriWin();

	if ( homeUri.data() )
	{
		const std::vector<clPtr<FS>> checkFS =
		{
			p->GetFSPtr(),
			g_MainWin->GetOtherPanel( p )->GetFSPtr()
		};

		FSPath path;
		clPtr<FS> fs = ParzeURI( homeUri.data(), path, checkFS );

		if ( fs.IsNull() )
		{
			char buf[4096];
			FSString name = homeUri.data();
			Lsnprintf( buf, sizeof( buf ), "bad home path: %s\n", name.GetUtf8() );
			NCMessageBox( g_MainWin, "Home", buf, true );
		}
		else
		{
			p->LoadPath( fs, path, 0, 0, PanelWin::SET );
		}
	}

#else
	const sys_char_t* home = (sys_char_t*) getenv( "HOME" );
	if ( !home )
	{
		return;
	}

	FSPath path( sys_charset_id, home );
	p->LoadPath( new FSSys(), path, 0, 0, PanelWin::SET );
#endif
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:40,代码来源:file-util.cpp


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