📄 wwhizinterface2.h
字号:
active projects.
@see GetProjectList
**/
virtual WWhizFileList& GetActiveFileList(void) const = 0;
/**
@return Returns the version of the WWhizInterface library.
Bits 24-31 = Major version. Bits 16-23 = Minor version. Bits 0-15 = Build.
@see GetProjectList
**/
virtual DWORD GetVersion(void) const = 0;
/**
For better efficiency, WWhizInterface maintains a list of files to check
for tag changes. If a file is modified, it should be added to WWhizInterface
via the AddChangedFile() function.
@param filename The full pathname of the file that changed.
**/
virtual void AddChangedFile(CString filename) = 0;
/**
After calling CheckActiveFilesForChanges(), the next tag refresh will
check every file in the workspace for changes.
**/
virtual void CheckActiveFilesForChanges() = 0;
/**
Retrieves the tag whose scope contains the specified line number.
@param filename The name of the file where the tag resides.
@param lineNumber The line number to match a tag's scope with.
@return Returns the tag whose scope contains lineNumber or NULL if no
tag is matched.
**/
virtual const WWhizTag* GetTagScope(const CString& filename, UINT lineNumber) = 0;
/**
@return Returns the open workspace filename.
**/
virtual const CString& GetWorkspaceFullPath(void) const = 0;
};
/**
WWhizInterface configuration information.
**/
class WWhizConfig
{
public:
///////////////////////////////////////////////////////////////////////////
// Files extension list.
///////////////////////////////////////////////////////////////////////////
/**
\internal Resets the file extension list to the defaults:
cpp, c, cxx, cc, h, hpp, hh, inl
Currently, the list of file extensions is only used by the registration
module's header flip.
**/
virtual void FilesExtReset() = 0;
/**
\internal Remove all extensions in the extension list.
**/
virtual void FilesExtRemoveAll() = 0;
/**
\internal Adds a new file extension.
**/
virtual void FilesExtAdd(CString ext) = 0;
/**
\internal Removes a file extension.
**/
virtual void FilesExtRemove(int index) = 0;
/**
\internal Gets a file extension from the list.
**/
virtual const CString& FilesExtGet(int index) = 0;
/**
\internal Retrieves the number of registered file extensions.
**/
virtual int FilesExtGetCount() = 0;
///////////////////////////////////////////////////////////////////////////
// Tags extension list.
///////////////////////////////////////////////////////////////////////////
/**
Resets the tag extension list to the defaults:
cpp, c, cxx, cc, h, hpp, hh, inl
The list of tag extensions is used when considering which files should
be processed by CTags.
**/
virtual void TagsExtReset() = 0;
/**
Remove all extensions in the extension list.
**/
virtual void TagsExtRemoveAll() = 0;
/**
Adds a new tag file extension.
**/
virtual void TagsExtAdd(CString ext) = 0;
/**
Removes a tag file extension.
**/
virtual void TagsExtRemove(int index) = 0;
/**
@return Retrieves the number of registered tag file extensions.
**/
virtual int TagsExtGetCount() = 0;
/**
@param index The tag extension index to retrieve.
@return Retrieves a tag extension from the list.
**/
virtual const CString& TagsExtGet(int index) = 0;
///////////////////////////////////////////////////////////////////////////
// Misc.
///////////////////////////////////////////////////////////////////////////
/**
The tags are automatically packed every x tag refreshes.
@return Retrieves the number of tag refreshes that must occur before
the tags are packed.
**/
virtual UINT GetTagAutoPackAmount() = 0;
/**
The tags are automatically packed every x tag refreshes.
@param amount The number of tag refreshes that must occur before
the tags are packs.
**/
virtual void SetTagAutoPackAmount(UINT amount) = 0;
/**
@return Retrieves whether tags are automatically force refreshed every
time WWhizInterface::RefreshTagList() is called.
**/
virtual bool GetAutoRefreshTags() = 0;
/**
@param autoRefresh Sets whether tags are automatically force refreshed every
time WWhizInterface::RefreshTagList() is called.
**/
virtual void SetAutoRefreshTags(bool autoRefresh) = 0;
/**
@return Retrieves whether files are automatically date/time checked
after a task switch has occurred.
**/
virtual bool GetScanFilesTaskSwitch() = 0;
/**
@param scanFiles Sets whether files are automatically date/time checked
after a task switch has occurred.
**/
virtual void SetScanFilesTaskSwitch(bool scanFiles) = 0;
///////////////////////////////////////////////////////////////////////////
// Tokens to ignore.
///////////////////////////////////////////////////////////////////////////
/**
Resets the token ignore list to the defaults:
_AFXWIN_INLINE
The list of tokens to ignore is used when files are processed by CTags.
**/
virtual void IgnoreTokensReset() = 0;
/**
Remove all tokens in the token ignore list.
**/
virtual void IgnoreTokensRemoveAll() = 0;
/**
Adds a new token to ignore.
**/
virtual void IgnoreTokensAdd(CString ext) = 0;
/**
Removes a token to ignore.
**/
virtual void IgnoreTokensRemove(int index) = 0;
/**
@return Retrieves the number of registered tag file extensions.
**/
virtual int IgnoreTokensGetCount() = 0;
/**
@param index The tag extension index to retrieve.
@return Retrieves a tag extension from the list.
**/
virtual const CString& IgnoreTokensGet(int index) = 0;
///////////////////////////////////////////////////////////////////////////
// Misc.
///////////////////////////////////////////////////////////////////////////
/**
The tags are automatically saved after there have been x file saves.
@return Retrieves the number of file saves that must occur before
the tags are saved.
**/
virtual UINT GetTagAutoSaveAmount() = 0;
/**
The tags are automatically saved after there have been x file saves.
@param amount The number of files saves that must occur before
the tags are saved.
**/
virtual void SetTagAutoSaveAmount(UINT amount) = 0;
};
/**
WWhizProjectList represents the list of projects contained within
WWhizInterface.
**/
class WWhizProjectList
{
public:
/**
@return Retrieves the number of projects in the list.
**/
virtual int GetProjectCount() const = 0;
/**
@param index The index of the project to retrieve.
@return Returns the WWhizProject at [index].
**/
virtual WWhizProject* GetProjectByIndex(int index) const = 0;
/**
Finds a project by full path name.
@param projectName The full path name to the project.
@return Returns the WWhizProject matching [projectName].
**/
virtual WWhizProject* Find(CString projectName) const = 0;
};
/**
Represents a single project.
**/
class WWhizProject
{
public:
/**
@return Retrieves the full path name to the project.
**/
virtual const CString& GetName(void) const = 0;
/**
@return Returns whether the project is active.
**/
virtual bool IsActive(void) const = 0;
/**
@return Retrieves the time stamp of the project file when it was read
in.
**/
virtual const CTime& GetTimeStamp(void) const = 0;
/**
@return Retrieves the project's file list.
**/
virtual WWhizFileList& GetFileList(void) const = 0;
/**
@return Retrieves the project's tag list.
**/
virtual WWhizTagList& GetTagList(void) const = 0;
/**
@return Returns true if the project is part of the active workspace,
false otherwise.
**/
virtual bool IsWorkspaceProject(void) const = 0;
/**
Sets whether the project is active or not. Be sure to call
WWhizInterface::RefreshFileList() after making this call.
@param active The new active state of the project.
**/
virtual void SetActive(bool active = true) = 0;
/**
Retrieve the XML data representing the project.
@return Returns a pointer to the XmlData object representing the project.
**/
virtual XmlData& GetXmlData() = 0;
};
/**
Represents a file list, usually sorted. Only contains unique filenames.
**/
class WWhizFileList
{
public:
/**
@return Retrieves the count of files in the file list.
**/
virtual int GetCount(void) const = 0;
/**
@param index The index of the WWhizFile to retrieve.
@return Retrieves the file at [index].
**/
virtual WWhizFile* Get(int index) const = 0;
/**
Searches for a file matching [fullName].
@param fullName The full path name of the file to find, case sensitive.
@return Returns the WWhizFile of the found file. If the file was not
found, returns NULL.
**/
virtual WWhizFile* Find(CString fullName) const = 0;
/**
Based on an existing WWhizFile, FindExact() finds the index
corresponding to that file.
@param An existing WWhizFile, obtained via WWhizFileList::Get() or
WWhizFileList::Create().
@return Returns the found index or -1 if not found.
**/
virtual int FindExact(WWhizFile& file) const = 0;
/**
Based on an existing WWhizFile, FindExact() finds the next index
corresponding to an approximate file match.
@param An existing WWhizFile, obtained via WWhizFileList::Get() or
WWhizFileList::Create().
@return Returns the found index or -1 if not found.
**/
virtual int FindNext(int startPos, WWhizFile& file) const = 0;
/**
Based on an existing WWhizFile, FindPrevious() finds the previous
index corresponding to an approximate file match.
@param An existing WWhizFile, obtained via WWhizFileList::Get() or
WWhizFileList::Create().
@return Returns the found index or -1 if not found.
**/
virtual int FindPrevious(int startPos, WWhizFile& file) const = 0;
/**
Based on a filename, Create() returns a new WWhizFile object that
has a reference count of 1. The application is responsible for
calling Release() on the file when done.
@param filename The filename to create a WWhizFile object from.
@return A WWhizFile describing [filename].
**/
virtual WWhizFile& Create(const CString& filename) = 0;
};
/**
Represents a file.
**/
class WWhizFile : public WWhizBase
{
public:
/**
@return Returns the lowercase version of the full path name.
**/
virtual const CString& GetFullName() const = 0;
/**
@return Returns the case-sensitive version of the full path name, as it
appears on disk.
**/
virtual CString GetCaseFullName() const = 0;
/**
To facilitate faster file lookups, every file has a "short" title
associated with it. The short name is all lowercase and only
contains alphanumeric characters. Underscores are not included.
Do not use GetShortName() for the display of the file title. Instead,
use GetTitle().
@return Returns the alphanumeric "short" title for the file.
**/
virtual const CString& GetShortName(void) const = 0;
/**
@return Returns the case-sensitive file title.
**/
virtual const CString& GetTitle(void) const = 0;
/**
@return Returns the lowercase file extension.
**/
virtual const CString& GetExt(void) const = 0;
/**
@return Returns the case-sensitive path name.
**/
virtual const CString& GetPath(void) const = 0;
/**
@return Returns the file stamp of the file the last time
WWhizInterface::RefreshFileList() was called.
**/
virtual const CTime& GetTimeStamp(void) const = 0;
/**
@return Returns the tag list associated with this file.
**/
virtual WWhizTagList& GetTagList(void) const = 0;
/**
Sets the short name of the file. Only use this function on file's
returned via WWhizFileList::Create().
@param shortName The new short name for the file.
**/
virtual void SetShortName(const CString& shortName) = 0;
/**
Sets the file title of the file. Only use this function on file's
returned via WWhizFileList::Create().
@param title The new title for the file.
**/
virtual void SetTitle(const CString& title) = 0;
/**
Sets the extension of the file. Only use this function on file's
returned via WWhizFileList::Create().
@param ext The new extension for the file.
**/
virtual void SetExt(const CString& ext) = 0;
/**
Sets the path of the file. Only use this function on file's
returned via WWhizFileList::Create().
@param ext The new path for the file.
**/
virtual void SetPath(const CString& path) = 0;
/**
Sets the time stamp of the file. Only use this function on file's
returned via WWhizFileList::Create().
@param ext The new time stamp for the file.
**/
virtual void SetTimeStamp(CTime timeStamp) = 0;
/**
@return Retrieves a non sorted tag list, ordered according their position
within the file.
**/
virtual WWhizTagList& GetOrderedTagList(void) const = 0;
/**
@return Returns whether this file is a member of the workspace or not.
**/
virtual bool IsWorkspaceFile(void) const = 0;
};
/**
Represents a sorted tag list.
**/
class WWhizTagList
{
public:
/**
@return Retrieves the count of tags in the tag list.
**/
virtual int GetCount(void) const = 0;
/**
@param index The index of the WWhizTag to retrieve.
@return Retrieves the tag at [index].
**/
virtual WWhizTag* Get(int index) const = 0;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -