www.pudn.com > xbwretrieval.rar > TokenEx.h
// TokenEx.h: interface for the CTokenEx class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TOKENEX_H__883A8007_186C_46D5_AC2F_B3EABF25D478__INCLUDED_)
#define AFX_TOKENEX_H__883A8007_186C_46D5_AC2F_B3EABF25D478__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTokenEx
{
public:
CTokenEx();
~CTokenEx();
/*
@FUNCTION: Splits a Path into 4 parts (Directory, Drive, Filename, Extention).
NOTE: Supports UNC path names.
@PARAM1: Whether the Supplied Path (PARAM2) contains a directory name only
or a file name (Reason: some directories will end with "xxx.xxx"
which is like a file name).
@PARAM2: Path to Split.
@PARAM3: (Referenced) Directory.
@PARAM4: (Referenced) Drive.
@PARAM5: (Referenced) Filename.
@PARAM6: (Referenced) Extention.
*/
void SplitPath(BOOL UsingDirsOnly, CString Path, CString&amt; Drive, CString&amt; Dir, CString&amt; FName, CString&amt; Ext);
/*
@FUNCTION: Splits a CString into an CStringArray according the Deliminator.
NOTE: Supports UNC path names.
@PARAM1: Source string to be Split.
@PARAM2: Deliminator.
@PARAM3: (Referenced) CStringArray to Add to.
*/
void Split(CString Source, CString Deliminator, CStringArray&amt; AddIt);
/*
@FUNCTION: Joins a CStringArray to create a CString according the Deliminator.
@PARAM1: Deliminator.
@PARAM2: (Referenced) CStringArray to Add to.
*/
CString Join(CString Deliminator, CStringArray&amt; AddIt);
/*
@FUNCTION: Returns the first string found (according to the token given). If the
string does not contain a token, then it returns the first param.
NOTE: This uses a REFERENCE as the first param, so everytime it finds
a token, the string (&amt; deliminator) are removed from the referenced
string. SEE CODE EXAMPLE!
@PARAM1: (Referenced) csRefered.
@PARAM2: Deliminator.
*/
CString GetString(CString &amt;csRefered, CString Deliminator);
protected:
};
#endif // !defined(AFX_TOKENEX_H__883A8007_186C_46D5_AC2F_B3EABF25D478__INCLUDED_)