/usr/include/codeblocks/cbworkspace.h is in codeblocks-dev 10.05-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | /*
* This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
* http://www.gnu.org/licenses/lgpl-3.0.html
*/
#ifndef CBWORKSPACE_H
#define CBWORKSPACE_H
#include <wx/string.h>
#include <wx/filename.h>
#include "globals.h"
/**
* @brief A workspace class.
*
* Workspaces are just collections of projects. By loading a workspace,
* all the projects it contains are loaded.\n
* There is always a workspace open. The default one does not contain any projects.\n
* Currently, no inter-project dependencies are supported but at some point
* they will be ;)
*
* @note The way WorkspaceLoader works now, requires that you save and delete the
* loaded workspace *before* creating a new one...
*/
class cbWorkspace
{
public:
/** @brief Constructor
*
* @param filename The file from which to load the workspace. If this
* parameter is empty, the default workspace is loaded.
*/
cbWorkspace(const wxString& filename = DEFAULT_WORKSPACE);
/** @brief Destructor */
virtual ~cbWorkspace();
/** @brief Save the workspace
*
* @param force If false (the default), the workspace will not be written to disk,
* if it is not marked as modified.
* @return True if saving succeeded, false if not.
*/
virtual bool Save(bool force = false);
/** @brief Save the workspace under a different filename
*
* @param filename The name of the file to save.
* @return True if saving succeeded, false if not.
* @note If the filename parameter is empty, a file dialog to choose
* the filename to save will be displayed.
*/
virtual bool SaveAs(const wxString& filename);
/** @brief Get the workspace file's name
*
* @return The name of the file this workspace was loaded from.
*/
virtual wxString GetFilename() const
{
return m_Filename.GetFullPath();
}
/** @brief Get the workspace's title
*
* @return The title of the workspace.
*/
virtual wxString GetTitle() const
{
return m_Title;
}
/** @brief Set the workspace's title
*
* @param title The new title.
*/
virtual void SetTitle(const wxString& title);
/** @brief Was this workspace loaded succesfully?
*
* @return True if the workspace was loaded succesfully, false if not.
* @note Because the only way to load a workspace is through its
* constructor, and because we don't use exceptions, this is the only
* way to know if loading succeeded.
*/
virtual bool IsOK() const { return m_IsOK; }
/** @brief Is this workspace the Code::Blocks default?
*
* @return True if the workspace is the default, false if not.
*/
virtual bool IsDefault() const { return m_IsDefault; }
/** @brief Is this workspace modified?
*
* @return True if the workspace is modified, false if not.
* @note A workspace is considered modified when projects
* are added-to/removed-from it, when the project's order
* is changed or when the active project is changed.
*/
virtual bool GetModified() const { return m_Modified; }
/** @brief Mark the workspace as modified or not
*
* @param modified If true, the workspace will be marked as modified. If
* false, the workspace will be marked as unmodified.
*/
virtual void SetModified(bool modified);
private:
bool m_IsOK; // succeeded loading?
bool m_IsDefault; // is this the Code::Blocks default workspace?
bool m_Modified; // is it modified?
wxFileName m_Filename; // filename
wxString m_Title; // title
void Load(); // utility function
};
#endif // CBWORKSPACE_H
|