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_IDENTIFI_SUB_H 00021 #define LIBAEGIS_CHANGE_IDENTIFI_SUB_H 00022 00023 #include <libaegis/change.h> 00024 #include <libaegis/file_revision.h> 00025 #include <libaegis/project/identifi_sub/branch.h> 00026 00027 class change_functor; // forward 00028 struct fstate_src_ty; // forward 00029 class nstring_list; // forward 00030 class project_file_roll_forward; // forward 00031 struct project_ty; // forward 00032 struct user_ty; // forward 00033 00041 class change_identifier_subset 00042 { 00043 public: 00048 ~change_identifier_subset(); 00049 00053 change_identifier_subset(project_identifier_subset &arg); 00054 00059 bool set() const; 00060 00086 void command_line_parse(void (*usage)(void)); 00087 00093 void command_line_check(void (*usage)(void)); 00094 00099 void set_baseline() { baseline = true; } 00100 00105 bool get_baseline() { return baseline; } 00106 00111 bool get_devdir(); 00112 00118 void set_project(); 00119 00125 void set_change(); 00126 00138 file_revision get_file_revision(const nstring &filename, 00139 change_functor &bad_state); 00140 00152 file_revision get_file_revision(fstate_src_ty *src, 00153 change_functor &bad_state); 00154 00165 void get_project_file_names(nstring_list &results); 00166 00176 fstate_src_ty *get_project_file(const nstring &file_name); 00177 00182 void set_project_name(string_ty *); 00183 00188 nstring get_change_version_string(); 00189 00194 project_ty *get_pp() { return pid.get_pp(); } 00195 00200 user_ty::pointer get_up() { return pid.get_up(); } 00201 00210 void set_user_by_name(nstring &login) { pid.set_user_by_name(login); } 00211 00216 change::pointer get_cp(); 00217 00225 long get_change_number(); 00226 00232 void error_if_no_explicit_change_number(); 00233 00243 project_file_roll_forward *get_historian(); 00244 00251 void invalidate_meta_data(); 00252 00253 private: 00258 project_identifier_subset_branch pid; 00259 00260 enum { NO_TIME_SET = -1 }; 00261 00266 bool baseline; 00267 00272 bool devdir; 00273 00278 long change_number; 00279 00285 long delta_date; 00286 00291 nstring delta_name; 00292 00297 long delta_number; 00298 00303 change::pointer cp; 00304 00310 project_file_roll_forward *historian_p; 00311 00317 bool need_historical_perspective() const; 00318 00322 change_identifier_subset(); 00323 00327 change_identifier_subset(const change_identifier_subset &); 00328 00332 change_identifier_subset &operator=(const change_identifier_subset &); 00333 }; 00334 00335 #endif // LIBAEGIS_CHANGE_IDENTIFI_SUB_H