00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 2004-2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_CHANGE_IDENTIFIER_H 00021 #define LIBAEGIS_CHANGE_IDENTIFIER_H 00022 00023 #include <libaegis/change/identifi_sub.h> 00024 #include <libaegis/file_revision.h> 00025 #include <libaegis/project/identifi_sub/plain.h> 00026 #include <libaegis/project/identifi_sub/branch.h> 00027 00038 class change_identifier 00039 { 00040 public: 00045 ~change_identifier(); 00046 00050 change_identifier(); 00051 00056 bool set() const { return change_id.set(); } 00057 00062 bool project_set() const { return project_id.set(); } 00063 00089 void 00090 command_line_parse(void (*usage)(void)) 00091 { 00092 change_id.command_line_parse(usage); 00093 } 00094 00101 void command_line_parse_rest(void (*usage)(void)); 00102 00103 bool get_devdir() { return change_id.get_devdir(); } 00104 00110 void 00111 command_line_check(void (*usage)(void)) 00112 { 00113 change_id.command_line_check(usage); 00114 } 00115 00120 void set_baseline() { change_id.set_baseline(); } 00121 00126 bool get_baseline() { return change_id.get_baseline(); } 00127 00138 file_revision 00139 get_file_revision(const nstring &filename, change_functor &bad_state) 00140 { 00141 return change_id.get_file_revision(filename, bad_state); 00142 } 00143 00155 file_revision 00156 get_file_revision(fstate_src_ty *src, change_functor &bad_state) 00157 { 00158 return change_id.get_file_revision(src, bad_state); 00159 } 00160 00165 void 00166 get_project_file_names(nstring_list &results) 00167 { 00168 change_id.get_project_file_names(results); 00169 } 00170 00180 fstate_src_ty * 00181 get_project_file(const nstring &file_name) 00182 { 00183 return change_id.get_project_file(file_name); 00184 } 00185 00195 project_file_roll_forward * 00196 get_historian() 00197 { 00198 return change_id.get_historian(); 00199 } 00200 00205 nstring 00206 get_change_version_string() 00207 { 00208 return change_id.get_change_version_string(); 00209 } 00210 00215 project_ty * 00216 get_pp() 00217 { 00218 return branch_id.get_pp(); 00219 } 00220 00225 user_ty::pointer 00226 get_up() 00227 { 00228 return branch_id.get_up(); 00229 } 00230 00239 void set_user_by_name(nstring &login) { branch_id.set_user_by_name(login); } 00240 00245 change::pointer 00246 get_cp() 00247 { 00248 return change_id.get_cp(); 00249 } 00250 00258 long 00259 get_change_number() 00260 { 00261 return change_id.get_change_number(); 00262 } 00263 00269 void 00270 error_if_no_explicit_change_number() 00271 { 00272 change_id.error_if_no_explicit_change_number(); 00273 } 00274 00281 void invalidate_change_meta_data() { change_id.invalidate_meta_data(); } 00282 00283 private: 00288 project_identifier_subset_plain project_id; 00289 00294 project_identifier_subset_branch branch_id; 00295 00300 change_identifier_subset change_id; 00301 00305 change_identifier(const change_identifier &); 00306 00310 change_identifier &operator=(const change_identifier &); 00311 }; 00312 00313 #endif // LIBAEGIS_CHANGE_IDENTIFIER_H