Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
890fa987
Commit
890fa987
authored
18 years ago
by
Thomas Feuvrier
Browse files
Options
Downloads
Patches
Plain Diff
Création class System
parent
e1bbe123
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbSystem.cxx
+54
-0
54 additions, 0 deletions
Code/Common/otbSystem.cxx
Code/Common/otbSystem.h
+44
-0
44 additions, 0 deletions
Code/Common/otbSystem.h
with
98 additions
and
0 deletions
Code/Common/otbSystem.cxx
0 → 100755
+
54
−
0
View file @
890fa987
/*=========================================================================
Programme : OTB (ORFEO ToolBox)
Auteurs : CS - T. Feuvrier
Language : C++
Date : 28 juin 2006
Version :
Role : System operation
$Id$
=========================================================================*/
#include
"otbSystem.h"
namespace
otb
{
//GetExtension from uiig library.
std
::
string
System
::
GetExtension
(
const
std
::
string
&
filename
)
{
// This assumes that the final '.' in a file name is the delimiter
// for the file's extension type
const
std
::
string
::
size_type
it
=
filename
.
find_last_of
(
"."
);
// This determines the file's type by creating a new string
// who's value is the extension of the input filename
// eg. "myimage.gif" has an extension of "gif"
std
::
string
fileExt
(
filename
,
it
+
1
,
filename
.
length
()
);
return
(
fileExt
);
}
//GetRootName from uiig library.
std
::
string
System
::
GetRootName
(
const
std
::
string
&
filename
)
{
const
std
::
string
fileExt
=
GetExtension
(
filename
);
// Create a base filename
// i.e Image.ent --> Image
if
(
fileExt
.
length
()
>
0
)
{
const
std
::
string
::
size_type
it
=
filename
.
find_last_of
(
fileExt
);
std
::
string
baseName
(
filename
,
0
,
it
-
fileExt
.
length
()
);
return
(
baseName
);
}
//Default to return same as input when the extension is nothing (Analyze)
return
(
filename
);
}
}
This diff is collapsed.
Click to expand it.
Code/Common/otbSystem.h
0 → 100755
+
44
−
0
View file @
890fa987
/*=========================================================================
Programme : OTB (ORFEO ToolBox)
Auteurs : CS - T. Feuvrier
Language : C++
Date : 28 juin 2006
Version :
Role : System operations
$Id$
=========================================================================*/
#ifndef _otbSystem_h
#define _otbSystem_h
#include
<string>
namespace
otb
{
/** \class System
* \brief System operations.
*
* System operations, filename manipulations, etc.
*
*/
class
System
{
public:
/** Standard class typedefs. */
typedef
System
Self
;
/** Get the extension of the file name */
static
std
::
string
GetExtension
(
const
std
::
string
&
filename
);
/** Get the root name */
static
std
::
string
GetRootName
(
const
std
::
string
&
filename
);
};
}
// namespace otb
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment