1 /*
2  * ====================================================================
3  * Copyright (c) 2002-2009 The RapidSvn Group.  All rights reserved.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program (in the file GPL.txt.
17  * If not, see <http://www.gnu.org/licenses/>.
18  *
19  * This software consists of voluntary contributions made by many
20  * individuals.  For exact contribution history, see the revision
21  * history and logs, available at http://rapidsvn.tigris.org/.
22  * ====================================================================
23  */
24 
25 // stl
26 #include "kdevsvncpp/string_wrapper.hpp"
27 
28 // svncpp
29 #include "kdevsvncpp/log_entry.hpp"
30 #include "kdevsvncpp/pool.hpp"
31 
32 // subversion api
33 #include "svn_time.h"
34 
35 
36 namespace svn
37 {
LogChangePathEntry(const char * path_,char action_,const char * copyFromPath_,const svn_revnum_t copyFromRevision_)38   LogChangePathEntry::LogChangePathEntry(
39     const char *path_,
40     char action_,
41     const char *copyFromPath_,
42     const svn_revnum_t copyFromRevision_)
43       : path(path_), action(action_),
44       copyFromPath(copyFromPath_ != nullptr ? copyFromPath_ : ""),
45       copyFromRevision(copyFromRevision_)
46   {
47   }
48 
49 
LogEntry()50   LogEntry::LogEntry()
51   {
52   }
53 
54 
LogEntry(const svn_revnum_t revision_,const char * author_,const char * date_,const char * message_)55   LogEntry::LogEntry(
56     const svn_revnum_t revision_,
57     const char * author_,
58     const char * date_,
59     const char * message_)
60   {
61     date = 0;
62 
63     if (date_ != nullptr)
64     {
65       Pool pool;
66 
67       if (svn_time_from_cstring(&date, date_, pool) != nullptr)
68         date = 0;
69     }
70 
71     revision = revision_;
72     author = author_ == nullptr ? "" : author_;
73     message = message_ == nullptr ? "" : message_;
74   }
75 }
76 
77 /* -----------------------------------------------------------------
78  * local variables:
79  * eval: (load-file "../../rapidsvn-dev.el")
80  * end:
81  */
82