|
WSF
|
#include <TextSource.hpp>
Inherits UtTextDocument.
Public Types | |
| enum | Flags { cINCLUDED = 1 , cCRITICAL = 2 , cCRITICAL_MASK = cCRITICAL | cINCLUDED } |
Public Member Functions | |
| TextSource (ProjectWorkspace *aProjectManagerPtr, const UtPath &aSourcePath) | |
| virtual | ~TextSource () |
| void | AddedToWorkspace () |
| bool | Load () |
| Load the file into memory if it has not been loaded. | |
| UtTextDocument * | GetSource () |
| bool | IsDeleted () const |
| void | SetDeleted (bool aIsDeleted) |
| bool | CheckForFileModifications (bool aAlwaysFullyReload) |
| void | HandleInsert (int aPosition, int aLength, const char *aText) |
| void | HandleDelete (int aPosition, int aLength) |
| TextSourceView * | NewView (Project *aProjectPtr) |
| TextSourceView * | GetView (Project *aParentPtr) |
| const std::vector< TextSourceView * > & | GetViews () const |
| void | EditorClosed (Editor *aEditorPtr) |
| void * | GetQtDocument () const |
| QTextDocument * | GetDocumentAsQTextDocument () const |
| void | ProjectParseUpdated () |
| bool | Save () |
| void | SaveWithNotifications () |
| void | SaveAs () |
| std::string | GetFileName () |
| std::string | GetSystemPath () const |
| void | Replace (const UtTextRange &aReplaceRange, const std::string &aText) |
| void | Append (const std::string &aText) |
| const std::vector< TextSourceChange > & | GetPendingChanges () const |
| bool | IsModified () const |
| void | SavePointReached () |
| bool | ReadSource (bool aAlwaysFullyReload=false) |
| ProjectWorkspace * | GetWorkspace () const |
| Project * | GetProject () |
| void | WaitForSourceModifications () |
| int | GetFlags () const |
| void | SetFlags (int aFlags) |
| bool | IsCritical () const |
| bool | IsLoaded () const |
| void | Unload () |
| Unload the file from memory if possible. | |
| void | ApplyModifications (UtTextRange &aRange, long long aStartSequenceNumber) const |
| size_t | ApplyModifications (size_t aPos, long long aStartSequenceNumber) const |
| void | ApplyPendingModifications (UtTextRange &aRange, UtTextDocument &aDocument) const |
| bool | HasAppliedChanges (long long aSequenceNumber) const |
| bool | HasPendingChanges () const |
| FileSignature | FileSignatureAtLoad () const |
| void | ReloadViews () |
| void | FindIncludeLocations () |
| void | BrowseContainingFolder () |
| void | CopyPathToClipboard () |
Static Public Member Functions | |
| static long long | GetNextSequenceNumber () |
| static void | SetObsoleteSequenceNumber (long long aNumber) |
| static void | DiffDocuments (const char *aOld, const char *aNew, QVector< TextSourceChange > &aChanges) |
| Compute differences between two null-terminated text strings. | |
Public Attributes | |
| UtCallbackListN< void(TextSource &)> | FileModifiedChange |
| Executes when file's modification state has changed. | |
Static Public Attributes | |
| static UtCallbackListN< void(TextSource *, size_t, int)> | TextSourceCharDeleted |
Friends | |
| class | wizard::Project |
| class | wizard::ProjectWorkspace |
TextSource is a file referenced by the project. The file may or may not be loaded into memory. Because of multi-threaded parsing, this class maintains a separate copy of the text when loaded in the text editor. Changes made to the document are queued and only applied when the parser has stopped. While TextSource inherits from UtTextDocument, using mutators from UtTextDocument directly is not advised.
| wizard::TextSource::TextSource | ( | ProjectWorkspace * | aProjectManagerPtr, |
| const UtPath & | aSourcePath ) |
References wizard::ProjectWorkspace.
Referenced by wizard::ProjectWorkspace.
|
virtual |
References Unload(), and wizSignals.
| void wizard::TextSource::AddedToWorkspace | ( | ) |
Referenced by wizard::ProjectWorkspace.
| void wizard::TextSource::Append | ( | const std::string & | aText | ) |
Referenced by wizard::CreatePlatformDialog::CreatePlatform().
| size_t wizard::TextSource::ApplyModifications | ( | size_t | aPos, |
| long long | aStartSequenceNumber ) const |
References wizard::TextSourceChange::ApplyChangeToPos().
| void wizard::TextSource::ApplyModifications | ( | UtTextRange & | aRange, |
| long long | aStartSequenceNumber ) const |
References wizard::TextSourceChange::ApplyChangeToRange().
| void wizard::TextSource::ApplyPendingModifications | ( | UtTextRange & | aRange, |
| UtTextDocument & | aDocument ) const |
| void wizard::TextSource::BrowseContainingFolder | ( | ) |
| bool wizard::TextSource::CheckForFileModifications | ( | bool | aAlwaysFullyReload | ) |
| void wizard::TextSource::CopyPathToClipboard | ( | ) |
References GetSystemPath().
Referenced by wizard::ActionManager::BuildUpTextSourceContextMenu(), and wizard::ActionManager::BuildUpTitleBarMenu().
|
static |
Compute differences between two null-terminated text strings.
References wizard::TextSourceChange::mCharsRemoved, wizard::TextSourceChange::mPos, and wizard::TextSourceChange::mText.
| void wizard::TextSource::EditorClosed | ( | Editor * | aEditorPtr | ) |
References GetWorkspace(), and Unload().
|
inline |
| void wizard::TextSource::FindIncludeLocations | ( | ) |
References GetProject().
Referenced by wizard::ActionManager::BuildUpTextSourceContextMenu(), and wizard::ActionManager::BuildUpTitleBarMenu().
|
inline |
| std::string wizard::TextSource::GetFileName | ( | ) |
Referenced by SaveAs().
|
inline |
Referenced by wizard::TextSourceCache::GetSource(), and wizard::RevisionStore::QueueAllProjectFiles().
|
inlinestatic |
Referenced by wizard::ParseWorker::Start().
|
inline |
| wizard::Project * wizard::TextSource::GetProject | ( | ) |
Referenced by FindIncludeLocations(), ProjectParseUpdated(), and ReadSource().
|
inline |
| UtTextDocument * wizard::TextSource::GetSource | ( | ) |
Referenced by wizard::EditorManager::CloseAllButIncluded(), wizard::EditorManager::CloseAllButStartup(), wizard::InputContext::ContextFromCursor(), wizard::ParseResults::FindIncludes(), wizard::CacheSourceProvider::FindSource(), wizard::ProjectWorkspace::FindSource(), wizard::WsfStyler::FoldDocument(), wizard::InputContext::GetContext(), wizard::InputContext::GetInputContext(), wizard::EditAssist::MakeAssistant(), wizard::EditorDock::ModificationChanged(), wizard::FindResultsControl::SearchFile(), wizard::WsfStyler::UpdateStyle(), wizard::SyntaxTips::UpdateSuggestions(), and wizard::ProjectWorkspace.
|
inline |
Referenced by wizard::EditorManager::AcceptsClose(), wizard::ActionManager::BuildUpTextSourceContextMenu(), wizard::EditorManager::CloseEditor(), CopyPathToClipboard(), wizard::TextSourceCache::DeleteSource(), wizard::Editor::Editor(), wizard::Environment::MarginClickAction(), NewView(), and Save().
| wizard::TextSourceView * wizard::TextSource::GetView | ( | Project * | aParentPtr | ) |
References NewView(), and wizard::Project.
Referenced by wizard::ProjectWorkspace::GotoFile(), wizard::Project::GotoRange(), and wizard::ProjectWorkspace::OpenSource().
|
inline |
Referenced by wizard::CreatePlatformDialog::CreatePlatform(), and wizard::ProjectWorkspace::OpenSource().
|
inline |
References wizard::ProjectWorkspace.
Referenced by EditorClosed(), NewView(), and ReadSource().
| void wizard::TextSource::HandleDelete | ( | int | aPosition, |
| int | aLength ) |
Safely deletes text from the document. Text changes must be reconciled by ProjectWorkspace at the appropriate time, therefore, the document will not be updated immediately.
| void wizard::TextSource::HandleInsert | ( | int | aPosition, |
| int | aLength, | ||
| const char * | aText ) |
Safely inserts text into the document. Text changes must be reconciled by ProjectWorkspace at the appropriate time, therefore, the document will not be updated immediately.
| bool wizard::TextSource::HasAppliedChanges | ( | long long | aSequenceNumber | ) | const |
|
inline |
|
inline |
References cCRITICAL_MASK.
|
inline |
Referenced by wizard::CacheSourceProvider::FindSource().
|
inline |
|
inline |
| bool wizard::TextSource::Load | ( | ) |
Load the file into memory if it has not been loaded.
References ReadSource().
Referenced by wizard::TextSourceCache::FindSource(), and wizard::TextSourceCache::GetSource().
| wizard::TextSourceView * wizard::TextSource::NewView | ( | Project * | aProjectPtr | ) |
References wizard::Editor::GetOffset(), GetSystemPath(), GetWorkspace(), wizard::WsfEditor::Initialize(), wizard::ProjectWorkspace::Instance(), Load(), pos, wizard::Editor::SetSelection(), and wizard::Project.
Referenced by wizard::CreatePlatformDialog::CreatePlatform(), GetView(), and wizard::ProjectWorkspace::OpenSource().
| void wizard::TextSource::ProjectParseUpdated | ( | ) |
References GetProject(), and wizard::Project.
| bool wizard::TextSource::ReadSource | ( | bool | aAlwaysFullyReload = false | ) |
References cMAXIMUM_FILE_SIZE, GetProject(), GetWorkspace(), SetDeleted(), and Unload().
Referenced by CheckForFileModifications(), wizard::CacheSourceProvider::FindSource(), and Load().
| void wizard::TextSource::ReloadViews | ( | ) |
| void wizard::TextSource::Replace | ( | const UtTextRange & | aReplaceRange, |
| const std::string & | aText ) |
Referenced by wizard::RenameFileDialog::OkClick().
| bool wizard::TextSource::Save | ( | ) |
References GetSystemPath().
Referenced by wizard::ActionManager::BuildUpTextSourceContextMenu(), and wizard::ActionManager::BuildUpTitleBarMenu().
| void wizard::TextSource::SaveAs | ( | ) |
| void wizard::TextSource::SavePointReached | ( | ) |
| void wizard::TextSource::SaveWithNotifications | ( | ) |
References Save(), and SaveWithNotifications().
Referenced by SaveWithNotifications().
| void wizard::TextSource::SetDeleted | ( | bool | aIsDeleted | ) |
Referenced by ReadSource().
|
inline |
Referenced by wizard::TextSourceCache::GetSource().
|
inlinestatic |
Referenced by wizard::ProjectWorkspace::customEvent().
| void wizard::TextSource::Unload | ( | ) |
Unload the file from memory if possible.
References cCRITICAL_MASK.
Referenced by EditorClosed(), ReadSource(), and ~TextSource().
| void wizard::TextSource::WaitForSourceModifications | ( | ) |
Referenced by SaveAs().
|
friend |
Referenced by GetView(), NewView(), and ProjectParseUpdated().
|
friend |
References AddedToWorkspace(), GetSource(), TextSource(), and wizard::ProjectWorkspace.
Referenced by GetWorkspace(), TextSource(), and wizard::ProjectWorkspace.
| UtCallbackListN<void(TextSource&)> wizard::TextSource::FileModifiedChange |
Executes when file's modification state has changed.
|
static |
Callback invoked when the given TextSource has characters removed
| void(TextSource*,size_t,int) | is the function signature. The first parameter is the given text source that changed. The second parameter is the position where the text changed. The third parameter is the amount of characters removed from the text. |