DSCopy.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib 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 Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/tools/dscopy/core/DSCopy.h
22 
23  \brief An utility class to provide methods to copy a Data Source
24  */
25 
26 #ifndef __TERRALIB_TOOLS_DSCOPY_DSCOPY_H
27 #define __TERRALIB_TOOLS_DSCOPY_DSCOPY_H
28 
29 // STL
30 #include <vector>
31 
32 namespace te
33 {
34  // Forward declarations
35  namespace da
36  {
37  class DataSource;
38  }
39 
40  namespace tools
41  {
42  namespace dscopy
43  {
44  /*!
45  \class DSCopy
46 
47  \brief Class with methods to manage the application
48  */
49  class DSCopy
50  {
51  public:
52 
53  /*!
54  \brief Init the application
55 
56  \param errorMessage String that receive errors description
57 
58  \return True if successfully
59  */
60  bool init(std::string & errorMessage);
61 
62  /*!
63  \brief Copy
64 
65  \param dsTypeOrigin The type of the origin Data Source
66  \param dsConnStrOrigin Origin Data Source connection string
67  \param dsTypeDestination The type of the destination Data Source
68  \param dsConnStrDestination Destination Data SourceConnection string
69  \param datasets DataSet names
70  \param errorMessage String that receive errors description
71 
72  \return True if successfully
73  */
74  bool copy(std::string dsTypeOrigin, std::string dsConnStrOrigin, std::string dsTypeDestination,
75  std::string dsConnStrDestination, std::vector<std::string*> datasets, std::string& errorMessage);
76 
77  /*!
78  \brief Copy
79 
80  \param dsOrigin The origin Data Source
81  \param dsDestination The destination Data Source
82  \param datasets DataSet names
83  \param errorMessage String that receive errors description
84 
85  \return True if successfully
86  */
87  bool copy(te::da::DataSource* dsOrigin, te::da::DataSource* dsDestination, std::vector<std::string*> datasets, std::string& errorMessage);
88 
89  private:
90 
91  /*!
92  \brief Copy a list of Data Sets
93 
94  \param dsOrigin The origin Data Source
95  \param dsDestination The destination Data Source
96  \param datasets DataSet names
97  \param errorMessage String that receive errors description
98 
99  \return True if successfully
100  */
101  bool copyDataSets(te::da::DataSource* dsOrigin, te::da::DataSource* dsDestination, std::vector<std::string*> datasets, std::string& errorMessage);
102 
103  };
104  }
105  }
106 }
107 
108 #endif //__TERRALIB_TOOLS_DSCOPY_DSCOPY_H
bool copy(std::string dsTypeOrigin, std::string dsConnStrOrigin, std::string dsTypeDestination, std::string dsConnStrDestination, std::vector< std::string * > datasets, std::string &errorMessage)
Copy.
bool copyDataSets(te::da::DataSource *dsOrigin, te::da::DataSource *dsDestination, std::vector< std::string * > datasets, std::string &errorMessage)
Copy a list of Data Sets.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:118
bool init(std::string &errorMessage)
Init the application.
URI C++ Library.
Class with methods to manage the application.
Definition: DSCopy.h:49