DataSourceInfo.cpp
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/dataaccess/datasource/DataSourceInfo.cpp
22 
23  \brief A conteiner class for keeping information about a data source.
24 */
25 
26 // TerraLib
27 #include "../../common/StringUtils.h"
28 #include "../../core/uri/URI.h"
29 #include "DataSourceInfo.h"
30 
31 // STL
32 #include <vector>
33 
35 
37 
38 const std::string& te::da::DataSourceInfo::getId() const
39 {
40  return m_id;
41 }
42 
43 void te::da::DataSourceInfo::setId(const std::string& id)
44 {
45  m_id = id;
46 }
47 
48 const std::string& te::da::DataSourceInfo::getType() const
49 {
50  return m_dsType;
51 }
52 
53 void te::da::DataSourceInfo::setType(const std::string& dsType)
54 {
55  m_dsType = dsType;
56 }
57 
58 const std::string& te::da::DataSourceInfo::getAccessDriver() const
59 {
60  return m_accessDriver;
61 }
62 
64 {
65  m_accessDriver = d;
66 }
67 
68 const std::string& te::da::DataSourceInfo::getTitle() const
69 {
70  return m_title;
71 }
72 
73 void te::da::DataSourceInfo::setTitle(const std::string& title)
74 {
75  m_title = title;
76 }
77 
78 const std::string& te::da::DataSourceInfo::getDescription() const
79 {
80  return m_description;
81 }
82 
83 void te::da::DataSourceInfo::setDescription(const std::string& d)
84 {
85  m_description = d;
86 }
87 
89 {
90  return m_connInfo;
91 }
92 
94 {
95  return m_connInfo.uri();
96 }
97 
99 {
100  m_connInfo = connInfo;
101 }
102 
103 void te::da::DataSourceInfo::setConnInfo(const std::string& connInfo)
104 {
105  te::core::URI aux(connInfo);
106  if(aux.isValid())
107  m_connInfo = aux;
108 }
109 
111 {
112  return m_id < rhs.m_id;
113 }
114 
void setDescription(const std::string &d)
const std::string & getDescription() const
bool isValid() const
Return if the given URI is valid or not.
Definition: URI.cpp:133
void setAccessDriver(const std::string &d)
te::core::URI m_connInfo
void setType(const std::string &dsType)
const std::string & getTitle() const
void setConnInfo(const te::core::URI &conninfo)
bool operator<(const DataSourceInfo &rhs) const
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
const te::core::URI & getConnInfo() const
void setId(const std::string &id)
const std::string & uri() const
Retrieving the full URI.
Definition: URI.cpp:88
const std::string & getAccessDriver() const
A conteiner class for keeping information about a data source.
const std::string & getId() const
A class for representing an Uniform Resource Identifier (URI).
Definition: URI.h:49
const std::string & getType() const
const std::string getConnInfoAsString() const
A class that represents a data source component.
void setTitle(const std::string &title)