Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Code
ApplicationEngine
otbWrapperParameterKey.cxx
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: ORFEO Toolbox
4
Language: C++
5
Date: $Date$
6
Version: $Revision$
7
8
9
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10
See OTBCopyright.txt for details.
11
12
13
This software is distributed WITHOUT ANY WARRANTY; without even
14
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
PURPOSE. See the above copyright notices for more information.
16
17
=========================================================================*/
18
#include "
otbWrapperParameterKey.h
"
19
20
#include <boost/algorithm/string.hpp>
21
22
namespace
otb
23
{
24
namespace
Wrapper
25
{
26
27
ParameterKey::ParameterKey
() : m_Key(
""
)
28
{
29
}
30
31
ParameterKey::ParameterKey
(
const
char
* val )
32
{
33
this->
SetKey
(std::string(val));
34
}
35
36
ParameterKey::ParameterKey
(
const
std::string & val )
37
{
38
this->
SetKey
(val);
39
}
40
41
ParameterKey::~ParameterKey
()
42
{
43
}
44
45
std::string
46
ParameterKey::GetLastElement
()
47
{
48
return
m_Key
.substr(
m_Key
.find_last_of(
"."
)+1,
m_Key
.size() );
49
}
50
51
std::string
52
ParameterKey::GetFirstElement
()
53
{
54
return
m_Key
.substr( 0,
m_Key
.find_first_of(
"."
) );
55
}
56
57
std::string
58
ParameterKey::GetRoot
()
59
{
60
return
m_Key
.substr( 0,
m_Key
.find_last_of(
"."
) );
61
}
62
63
64
std::vector<std::string>
65
ParameterKey::Split
()
66
{
67
std::vector<std::string> res;
68
boost::split(res,
m_Key
, boost::is_any_of(
"."
), boost::token_compress_on);
69
70
return
res;
71
}
72
73
void
74
ParameterKey::Append
(
const
std::string & val )
75
{
76
m_Key
.append(
"."
);
77
m_Key
.append(val);
78
}
79
80
81
void
82
ParameterKey::Append
(
const
ParameterKey
& pKey )
83
{
84
this->
Append
( pKey.
GetKey
() );
85
}
86
87
}
// end namespace Wrapper
88
}
//end namespace otb
Generated at Sun Feb 3 2013 00:59:20 for
Orfeo Toolbox
with
doxygen 1.8.1.1