GME
13
|
00001 00022 #pragma once 00023 #include "Revision.h" 00024 #include "Targets.h" 00025 #include "svn_client.h" 00026 #include "Prompter.h" 00027 00028 // class mimicing subversion/bindings/java/javahl/native/svnclient.cpp 00029 00030 class ClientUtil 00031 { 00032 public: 00033 // 00034 // ******** Info ********* 00035 // 00036 struct InfoHelp 00037 { 00038 struct InfoEntry 00039 { 00040 const char *m_path; 00041 svn_info_t *m_info; 00042 }; 00043 00044 typedef std::vector<InfoEntry> InfoVec; 00045 typedef InfoVec::const_iterator InfoVecConIter; 00046 00047 struct InfoBaton 00048 { 00049 InfoVec m_infoVect; 00050 apr_pool_t *m_pool; 00051 }; 00052 00053 // callback, which will fill an InfoBaton struct (got in void *baton) 00054 static svn_error_t * infoReceiver(void *baton, 00055 const char *path, 00056 const svn_info_t *info, 00057 apr_pool_t *pool); 00058 00059 }; 00060 00061 // 00062 // ******** Commit related helper ********* 00063 // 00064 struct CommitHelp 00065 { 00066 class MsgBuilder // builds a proper commit message based on entries 00067 { 00068 void dealWithItem( std::string& res, svn_client_commit_item_t * item); 00069 public: 00070 std::string build( const apr_array_header_t *commit_items); 00071 }; 00072 00073 struct LogMsgBaton // log_msg_baton 00074 { 00075 const char * m_message; 00076 MsgBuilder * m_messageHandler; 00077 }; 00078 00079 // creates the baton class given to the callback 00080 static void* createLogMsgBaton( const char * p_strMessage, CommitHelp::MsgBuilder * p_msgComposer, apr_pool_t *pool); 00081 00082 00083 // callback, which is called by commit-y operations 00084 static svn_error_t * logMsg(const char **log_msg, 00085 const char **tmp_file, 00086 const apr_array_header_t *commit_items, 00087 void *baton, 00088 apr_pool_t *pool); 00089 00090 }; 00091 00092 00093 // 00094 // ******** Notify : a Commit and Checkout related helper ********* 00095 // 00096 struct NotifyHelp 00097 { 00098 std::string m_msg; 00099 bool m_OK; 00100 00107 void onNotify( const svn_wc_notify_t *notify, apr_pool_t *pool); 00108 00116 // callback, which is called during notification 00117 static void notify2(void *baton, 00118 const svn_wc_notify_t *notify, 00119 apr_pool_t *pool); 00120 00121 }; 00122 00123 // ************************************** 00124 // other callbacks 00125 // ************************************** 00126 struct OtherHelp 00127 { 00128 static svn_error_t * checkCancel(void *cancelBaton); 00129 }; 00130 00131 // 00132 // ******** Status related helper ********* 00133 // 00134 struct StatusHelp 00135 { 00136 struct StatusEntry 00137 { 00138 const char * m_path; 00139 svn_wc_status2_t * m_status; 00140 }; 00141 00142 struct StatusBaton 00143 { 00144 std::vector<StatusEntry> m_statusVect; 00145 apr_pool_t * m_pool; 00146 }; 00147 00148 static void statusReceiver(void *baton, const char *path, 00149 svn_wc_status2_t *status); 00150 }; 00151 00152 typedef std::pair<std::string, long> StatusInfo; 00153 StatusInfo sub_single_status(const char *path, bool onServer); 00154 00155 typedef StatusHelp::StatusEntry StatusExtInfo; 00156 typedef std::vector<StatusExtInfo> StatusExtInfoVec; 00157 StatusExtInfoVec sub_extended_status( const char * p_path, bool p_onServer); 00158 00159 // statics 00160 static std::string charstar2str( const char* p_charStar, const std::string p_name); 00161 00162 };