Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
21e09044
Commit
21e09044
authored
Nov 23, 2020
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: add getters for the date components in otb::Metadata::Time
parent
a3511bfc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
Modules/Core/Metadata/include/otbMetaDataKey.h
Modules/Core/Metadata/include/otbMetaDataKey.h
+11
-0
Modules/Core/Metadata/src/otbMetaDataKey.cxx
Modules/Core/Metadata/src/otbMetaDataKey.cxx
+31
-0
No files found.
Modules/Core/Metadata/include/otbMetaDataKey.h
View file @
21e09044
...
...
@@ -272,6 +272,17 @@ struct OTBMetadata_EXPORT Time : tm
return
!
(
lhs
<
rhs
);
}
/** @name Getters
* Getters on the date components
*/
///@{
int
GetDay
()
const
;
int
GetMonth
()
const
;
int
GetYear
()
const
;
int
GetHour
()
const
;
int
GetMinute
()
const
;
int
GetSecond
()
const
;
///@}
};
...
...
Modules/Core/Metadata/src/otbMetaDataKey.cxx
View file @
21e09044
...
...
@@ -196,6 +196,37 @@ std::istream& operator>>(std::istream& is, Time& val)
#undef _OTB_ISTREAM_EXPECT
int
Time
::
GetDay
()
const
{
return
tm_mday
;
}
int
Time
::
GetMonth
()
const
{
return
tm_mon
+
1
;
}
int
Time
::
GetYear
()
const
{
return
tm_year
+
1900
;
}
int
Time
::
GetHour
()
const
{
return
tm_hour
;
}
int
Time
::
GetMinute
()
const
{
return
tm_min
;
}
int
Time
::
GetSecond
()
const
{
return
tm_sec
+
frac_sec
;
}
std
::
string
LUTAxis
::
ToJSON
(
bool
multiline
)
const
{
std
::
ostringstream
oss
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment