XII Release 0.1.0
Loading...
Searching...
No Matches
xiiToolsProject Class Reference

Public Member Functions

xiiStringBuilder GetPathForDocumentGuid (const xiiUuid &guid)
 Resolve document GUID into an absolute path.
const xiiString & GetProjectFile () const
 Returns the path to the 'xiiProject' file.
const xiiString GetProjectName (bool bSanitize) const
xiiString GetProjectDirectory () const
 Returns the path in which the 'xiiProject' file is stored.
xiiString GetProjectDataFolder () const
 Returns the directory path in which project settings etc. should be stored.
bool IsDocumentInAllowedRoot (xiiStringView sDocumentPath, xiiString *out_pRelativePath=nullptr) const
void AddAllowedDocumentRoot (xiiStringView sPath)
void CreateSubFolder (xiiStringView sFolder) const
 Makes sure the given sub-folder exists inside the project directory.

Static Public Member Functions

static bool IsProjectOpen ()
static bool IsProjectClosing ()
static void CloseProject ()
static void SaveProjectState ()
static bool CanCloseProject ()
 Returns true when the project can be closed. Uses xiiToolsProjectRequest::Type::CanCloseProject event.
static bool CanCloseDocuments (xiiArrayPtr< xiiDocument * > documents)
 Returns true when the given list of documents can be closed. Uses xiiToolsProjectRequest::Type::CanCloseDocuments event.
static xiiInt32 SuggestContainerWindow (xiiDocument *pDoc)
static xiiStatus OpenProject (xiiStringView sProjectPath)
static xiiStatus CreateProject (xiiStringView sProjectPath)
static void BroadcastSaveAll ()
 Broadcasts the SaveAll event, though otherwise has no direct effect.
static void BroadcastConfigChanged ()
static xiiString FindProjectDirectoryForDocument (xiiStringView sDocumentPath)
 Starts at the given document and then searches the tree upwards until it finds a xiiProject file.

Static Public Attributes

static xiiEvent< const xiiToolsProjectEvent &, xiiMutex > s_Events
static xiiEvent< xiiToolsProjectRequest & > s_Requests

Member Function Documentation

◆ BroadcastConfigChanged()

void xiiToolsProject::BroadcastConfigChanged ( )
static

Sent when global project configuration data was changed and thus certain menus would need to update their content (or just deselect any item, forcing the user to reselect and thus update state)

◆ GetProjectName()

const xiiString xiiToolsProject::GetProjectName ( bool bSanitize) const

Returns the short name of the project (extracted from the path).

Parameters
bSanitizeWhether to replace whitespace and other problematic characters, such that it can be used in code.

◆ SuggestContainerWindow()

xiiInt32 xiiToolsProject::SuggestContainerWindow ( xiiDocument * pDoc)
static

Returns the unique ID of the container window this document should use for its window. Uses xiiToolsProjectRequest::Type::SuggestContainerWindow event.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Tools/Libs/ToolsFoundation/Project/ToolsProject.h
  • /home/runner/work/XII/XII/Source/Tools/Libs/ToolsFoundation/Project/ToolsProject.cpp