00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 2001-2006, 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_PATCH_H 00021 #define LIBAEGIS_PATCH_H 00022 00023 #include <libaegis/common.h> 00024 #include <libaegis/patch/hunk_list.h> 00025 #include <common/str_list.h> 00026 00031 class patch_ty 00032 { 00033 public: 00037 ~patch_ty(); 00038 00042 patch_ty(); 00043 00048 void append(patch_hunk_ty *php); 00049 00050 // private: 00051 string_list_ty name; 00052 file_action_ty action; 00053 file_usage_ty usage; 00054 patch_hunk_list_ty actions; 00055 00056 private: 00060 patch_ty(const patch_ty &); 00061 00065 patch_ty &operator=(const patch_ty &); 00066 }; 00067 00068 struct input_ty; // forward 00069 00070 bool patch_apply(patch_ty *, string_ty *, string_ty *); 00071 00072 inline patch_ty * 00073 patch_new(void) 00074 { 00075 return new patch_ty(); 00076 } 00077 00078 inline void 00079 patch_delete(patch_ty *pp) 00080 { 00081 delete pp; 00082 } 00083 00084 inline void 00085 patch_append(patch_ty *pp, patch_hunk_ty *php) 00086 { 00087 pp->append(php); 00088 } 00089 00090 #endif // LIBAEGIS_PATCH_H