|
Aegis
4.25.D505
|
#include <project.h>
The project class is used to remember the state of a project.
Eventually, it will be discouraged to use this class directly. The preferred method will be to access it via a project class (see below) smart pointer. This will be able to guarantee the reference counting semantics.
This class is presently in transition from being a C struct. One by one the access functions will be turned into access methids, and the instance variables will become private.
| typedef project* project::pointer |
The pointer typedef is provided so that clients of this interface may use change::pointer everywhere they need to point at a change instance, and only this typedef needs to be edited to use a variety of smart pointer instead.
The destructor.
It is not virtual; thou shalt not derive fron this class.
| project::project | ( | string_ty * | name | ) |
The constructor.
| name | The name of the project. |
| project::project | ( | ) | [private] |
The default constructor.
Do not use this method. It is not defined. Projects will always have a name, it it shall always be supplied to the constructor.
| project::project | ( | const project & | ) | [private] |
The copy constructor. Do not use.
The prefereed mechanism is to use the reference counting provided the the project class (see below) smart pointer.
| nstring project::attribute_get | ( | const nstring & | name | ) |
The attribute_get method is used to obtain the value of an attribute of this project.
The project attributes are kept in the project_specific field of the project config file (aegis.conf) which is a project source file. Only use this method when you want the baseline attributes, use change::pconf_attributes_find within a change set.
| name | The name of the attribute. Attribute names are not case sensitive. |
| bool project::attribute_get_boolean | ( | const nstring & | name | ) |
The attribute_get_boolean method is used to obtain the value of an attribute of this project, as a true/false value.
The project attributes are kept in the project_specific field of the project config file (aegis.conf) which is a project source file. Only use this method when you want the baseline attributes, use change::pconf_attributes_find_boolean within a change set.
| name | The name of the attribute. Attribute names are not case sensitive. |
| string_ty* project::baseline_path_get | ( | bool | resolve = false | ) |
The baseline_path_get method is used to obtain the absolure path of the project's (branch's) baseline.
| resolve | Whether or not to resolve all of the symlinks in the path. |
The bind_branch method is used to bind a branch of this project into a new project object.
| bp | The change corresponding to the project of interest. |
| void project::bind_existing | ( | ) |
The bind_existing method is used to bind a newly created project object to an existing project.
| bool project::bind_existing_errok | ( | ) |
The bind_existing_errok method is used to bind a newly created project object to an existing project.
| void project::bind_keep | ( | const nstring & | path | ) |
The bind_keep method is used to bind a new project to an existing directory, as needed by the "aenpr -keep" option.
| path | The directory containing the project. |
| void project::bind_new | ( | ) |
The bind_new method is used to bind a new project object to a new name. This will create all of the necessary data structures and (eventually) files, once the project directory has been set.
| time_t project::change_completion_timestamp | ( | long | change_number | ) |
The change_completion_timestamp is used to determine the completion timestamp of a change.
| change_number | the number of the change. |
| change::pointer project::change_get | ( | void | ) |
The change_get method is used to obtain a pointer to the change object representing this project branch.
| change::pointer project::change_get_raw | ( | ) | [inline] |
The change_get_raw method is used to obtain a pointer to the change object representing this project branch or NULL if no such object is in the project.
| string_ty* project::change_path_get | ( | long | change_number | ) |
The change_path_get method is used to obtain the absolute path of the meta-data of a specific change set.
| change_number | The number of the change for which the path is desired. |
| void project::change_reset | ( | ) | [inline] |
The changes_path_get method is used to obtain the absolute path of the directory containing change set meta-data.
| void project::convert_to_new_format | ( | ) |
The convert_to_new_format method is used to convert Aegis 2.3 project meta-data into Aegis 3.0 (and later) project meta-data.
| void project::copy_the_owner | ( | project * | pp | ) |
The copy_the_owner method is used to copy the owner from another project. It is only ever used by aenrls, which sort-of clones another project. Don't use this method.
Note: this is only a transient requirement for new projects. Existing projects take their uid and gid from the Unix uid and gid of the project directory.
| void project::copyright_years_slurp | ( | int * | a, |
| int | amax, | ||
| int * | alen_p | ||
| ) |
the copyright_years_slurp method is used to determine the range of copyright years covered by this project and all its ancrestor projects back to the trunk.
| a | The array to store the results in |
| amax | The maximum number of distinct years which can be stored in the array (see SIZEOF macro). |
| alen_p | This is a pointer to the array length used to date. |
| bool project::file_directory_query | ( | const nstring & | filename, |
| nstring_list & | result_in, | ||
| nstring_list & | result_out, | ||
| view_path_ty | as_view_path | ||
| ) |
The file_directory_query method is used to determine whether or not a given file name is actually a directory name, and if it is, expand it into a list of files below that directory.
| filename | The name of the file to be checked. |
| result_in | If the filename is a directory, will be filled with a list of files existing in that directory. |
| result_out | If the filename is a directory, will be filled with a list of removed files from that directory. |
| as_view_path | The view path style to be used. |
| void project::file_directory_query | ( | string_ty * | filename, |
| struct string_list_ty * | result_in, | ||
| struct string_list_ty * | result_out, | ||
| view_path_ty | as_view_path | ||
| ) |
The file_directory_query method is used to determine whether or not a given file name is actually a directory name, and if it is, expand it into a list of files below that directory.
| filename | The name of the file to be checked. |
| result_in | If not NULL, and if the filename is a directory, will be filled with a list of files existing in that directory. |
| result_out | If not NULL, and if the filename is a directory, will be filled with a list of removed files from that directory. |
| as_view_path | The view path style to be used. |
| bool project::file_exists | ( | const nstring & | filename | ) |
The file_exists method is used to determine whether or not a file exists in the project baseline, or any of the ancestor basleines.
| filename | The base-relative name of the file to search for. |
| fstate_src_ty* project::file_find | ( | const nstring & | filename, |
| view_path_ty | as_view_path | ||
| ) |
The file_find method is used to find the state information of the named file within the project. It will search the immediate branch, and then any ancestor branches until the file is found.
| filename | The base-relative name of the file to search for. |
| as_view_path | If this is true, apply viewpath rules to the file (i.e. if it is removed, return a null pointer) if false return first instance found. |
| fstate_src_ty* project::file_find | ( | string_ty * | filename, |
| view_path_ty | as_view_path | ||
| ) |
The file_find method is used to find the state information of the named file within the project. It will search the immediate branch, and then any ancestor branches until the file is found.
| filename | The base-relative name of the file to search for. |
| as_view_path | If this is true, apply viewpath rules to the file (i.e. if it is removed, return a null pointer) if false return first instance found. |
| fstate_src_ty* project::file_find | ( | fstate_src_ty * | c_src, |
| view_path_ty | as_view_path | ||
| ) |
The file_find method is used to find the state information of a file within the project, given the corresponding change file's meta-data. It will search the immediate branch, and then any ancestor branches until the file is found.
| c_src | The change file meta-data for which the corresponding project file is sought. |
| as_view_path | If this is true, apply viewpath rules to the file (i.e. if it is removed, return a null pointer) if false return first instance found. |
| fstate_src_ty* project::file_find | ( | cstate_src_ty * | c_src, |
| view_path_ty | as_view_path | ||
| ) |
The file_find method is used to find the state information of a file within the project, given the corresponding change file's meta-data. It will search the immediate branch, and then any ancestor branches until the file is found.
| c_src | The change file meta-data for which the corresponding project file is sought. |
| as_view_path | If this is true, apply viewpath rules to the file (i.e. if it is removed, return a null pointer) if false return first instance found. |
| fstate_src_ty* project::file_find_by_uuid | ( | string_ty * | uuid, |
| view_path_ty | vp | ||
| ) |
The file_find_by_uuid method is used to find the state information of a file within the project, given the file's UUID. It will search the immediate branch, and then any ancestor branches until the file is found.
| uuid | The UUID of the file to search for. |
| vp | If this is true, apply viewpath rules to the file (i.e. if it is removed, return a null pointer) if false return first instance found. |
| fstate_src_ty* project::file_find_fuzzy | ( | string_ty * | filename, |
| view_path_ty | as_view_path | ||
| ) |
The file_find_fuzzy method is used to find the state information for a project file when the project::file_find function fails. It uses fuzzy string matching, which is significantly slower than exact searching, but can provide very useful error messages for users.
| filename | The base-relative name of the file to search for. |
| as_view_path | If this is true, apply viewpath rules to the file (i.e. if it is removed, return a null pointer) if false return first instance found. |
| struct string_list_ty* project::file_list_get | ( | view_path_ty | as_view_path | ) | [read, private] |
The file_list_get method is used to obtain a list of file names. The lists are calculated on demand and cached.
| as_view_path | The view path style to use when calculating the list of project files. |
| void project::file_list_invalidate | ( | ) |
The file_list_invalidate method is used to clear the cahced project file information when it becomes stale.
| fstate_src_ty* project::file_new | ( | string_ty * | file_name | ) |
The file_new method is used to create a new project file by name, and add it to the project file manifest. No validation is done, the called must guarantee that the file name is unique.
| file_name | The base-relative name of the file to search for. |
| fstate_src_ty* project::file_new | ( | fstate_src_ty * | meta | ) |
The file_new method is used to create a new project file from the meta data of an existing (usually change set) file, and add it to the project file manifest. No validation is done, the caller must guarantee that the file name and UUID are unique.
| meta | The meta data, including the name and UUID, of the file to be created. |
| fstate_src_ty* project::file_nth | ( | size_t | n, |
| view_path_ty | as_view_path | ||
| ) |
The file_nth method is used to get the 'n'th file from the list of project files.
| n | The file number to obtain (zero based). |
| as_view_path | The style of view path to use when calculating the list. |
| project* project::find_branch | ( | const char * | number | ) |
The find_branch method is used to locate the branch with the given number in this project.
| number | The branch number to locate. |
| void project::get_the_owner | ( | ) | [private] |
The get_the_owner method is used to determine the Unix pid and gid for the project.
| user_ty::pointer project::get_user | ( | ) | const |
The get_user method may be used to obtain a pointer to the user (and group) ownership date for this project.
| int project::gid_get | ( | ) |
The gid_get method is used to obtain the Unix group id of the project owner.
The history_path_get method is used to determine the top-level directory of the tree which is used to hold the project's history files.
The home_path_get method is used to get the "home" directory of a project; the directory which contains trunk's delta directories and the baseline, and the "info" meta-data directory.
| void project::home_path_set | ( | string_ty * | dir | ) |
The home_path_set method is used when creating a new project to remeber the directory the project beaselines and meta-data are stored within.
| dir | The absolute path of the directory in which to keep the project. To cope with automounters, directories are stored as given, or are derived from the home directory in the passwd file. Within Aegis, pathnames have their symbolic links resolved, and any comparison of paths is done on this "system idea" of the pathname. |
| void project::home_path_set | ( | const nstring & | dir | ) |
The info_path_get method is used to obtain the absolute path of the meta-data file for this project (branch).
| bool project::is_a_trunk | ( | ) | const [inline] |
| void project::list_inner | ( | string_list_ty & | result | ) |
The list_inner method is used to append the branch names to the result list. This is one step of building a complete list of projects.
| result | Append all project branch names to this list. |
| void project::lock_prepare_everything | ( | ) |
The lock_prepare_everything method is used to take a resd-only lock of everything in the project: pstate, baseline, changes, and recurse into all active branches.
| void project::lock_sync | ( | ) | [private] |
The lock_sync method is used to invalidate the project state data if the lock has been released and taken again.
| string_ty* project::name_get | ( | ) | const |
The name_get method is used to get the name of the project.
The assignment operator. Do not use.
The prefereed mechanism is to use the reference counting provided the the project class (see below) smart pointer.
| long project::parent_branch_number_get | ( | ) | const [inline] |
| project* project::parent_get | ( | ) | [inline] |
The pstate_get method is used to obtain the project state data.
| void project::pstate_lock_prepare | ( | ) |
The pstate_lock_prepare method is used to prepare to take a project pstate lock for this project, prior to lock_take() being called.
The pstate_path_get method is used to obtain the absolute path of the pstate (project state) file.
| void project::pstate_write | ( | ) |
The pstate_write method is used to write out the project state data into the meta-data directory tree.
| void project::search_path_get | ( | string_list_ty * | result, |
| bool | resolve | ||
| ) |
The search_path_get method may be used to obtain the search path (list of progressively more out-of-date ancestor btranches) within which to search for files.
| result | Where to append the additional directories. |
| resolve | Whether or not to expand synbolic links within paths. |
| void project::search_path_get | ( | nstring_list & | result, |
| bool | resolve | ||
| ) |
The search_path_get method may be used to obtain the search path (list of progressively more out-of-date ancestor btranches) within which to search for files.
| result | Where to append the additional directories. |
| resolve | Whether or not to expand synbolic links within paths. |
The trunk_get method is used to find the trunk project of this project, then top-level branch of this project.
| int project::uid_get | ( | ) |
The uid_get method is used to obtain the Unix user id of the project owner.
| int project::umask_get | ( | ) |
The umask_get method is used to obtain the file creation mode mask for this project.
string_ty* project::baseline_path [private] |
The baseline_path_unresolved instance variable is used to remember the absolute path of this project's (branch's) baseline directory. It has not had is symbolic links resolved. All access is via the baseline_path_get method, which takes care of calculating it on demand.
string_ty* project::baseline_path_unresolved [private] |
The baseline_path_unresolved instance variable is used to remember the absolute path of this project's (branch's) baseline directory. It has not had is symbolic links resolved. All access is via the baseline_path_get method, which takes care of calculating it on demand.
itab_ty* project::change2time_stp [private] |
string_ty* project::changes_path [private] |
struct symtab_ty* project::file_by_uuid[view_path_MAX] [private] |
The file_by_uuid instance variable is used to remember a symbol table of files indexed by UUID (or by file name if your project has any files without a UUID for backwards compatibility).
This instance variable shall always be accessed via the find_file_by_uuid method. The tables are calculated on demand and cached.
struct string_list_ty* project::file_list[view_path_MAX] [private] |
int project::gid [private] |
string_ty* project::history_path [private] |
string_ty* project::home_path [private] |
The home_path instance variable is used to remember the "home" directory of a project; the directory which contains trunk's delta directories and the baseline, and the "info" meta-data directory.
string_ty* project::info_path [private] |
bool project::is_a_new_file [private] |
long project::lock_magic [private] |
The lock_magic instance variable is used to remember the last time the lock was taken. If the lock_sync function returns different, it means we have to invalidate all our project data and read it in again, because something could have changed. Only every accessed by the lock_sync ethod.
string_ty* project::name [private] |
bool project::off_limits [private] |
The off_limits instance variable is used to remember when a project is inaccessable to the executing user. This flag is normally false, but it will be set to true by project::bind_existing for projects which are inaccessable.
project* project::parent [private] |
long project::parent_bn [private] |
change::pointer project::pcp [private] |
The pcp instance variable is used to remember the change object representing this branch's state.
pstate_ty* project::pstate_data [private] |
string_ty* project::pstate_path [private] |
int project::uid [private] |
user_ty::pointer project::up [private] |
1.7.6.1