Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
mantidproject
mantid
Commits
46e6b49a
Commit
46e6b49a
authored
11 years ago
by
Ricardo Leal
Browse files
Options
Downloads
Patches
Plain Diff
Re #6771 added pathOfType method
parent
9ab01da5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/Kernel/inc/MantidKernel/HDFDescriptor.h
+2
-0
2 additions, 0 deletions
.../Mantid/Framework/Kernel/inc/MantidKernel/HDFDescriptor.h
Code/Mantid/Framework/Kernel/src/HDFDescriptor.cpp
+14
-0
14 additions, 0 deletions
Code/Mantid/Framework/Kernel/src/HDFDescriptor.cpp
with
16 additions
and
0 deletions
Code/Mantid/Framework/Kernel/inc/MantidKernel/HDFDescriptor.h
+
2
−
0
View file @
46e6b49a
...
@@ -91,6 +91,8 @@ namespace Mantid
...
@@ -91,6 +91,8 @@ namespace Mantid
bool
pathExists
(
const
std
::
string
&
path
)
const
;
bool
pathExists
(
const
std
::
string
&
path
)
const
;
/// Query if a path exists of a given type
/// Query if a path exists of a given type
bool
pathOfTypeExists
(
const
std
::
string
&
path
,
const
std
::
string
&
type
)
const
;
bool
pathOfTypeExists
(
const
std
::
string
&
path
,
const
std
::
string
&
type
)
const
;
/// return the path of a given type
std
::
string
pathOfType
(
const
std
::
string
&
type
);
/// Query if a given type exists somewhere in the file
/// Query if a given type exists somewhere in the file
bool
classTypeExists
(
const
std
::
string
&
classType
)
const
;
bool
classTypeExists
(
const
std
::
string
&
classType
)
const
;
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/Kernel/src/HDFDescriptor.cpp
+
14
−
0
View file @
46e6b49a
...
@@ -165,6 +165,20 @@ namespace Mantid
...
@@ -165,6 +165,20 @@ namespace Mantid
else
return
false
;
else
return
false
;
}
}
/**
* @param type A string specifying the required type
* @return path A string giving a path using UNIX-style path separators (/), e.g. /raw_data_1, /entry/bank1
*/
std
::
string
HDFDescriptor
::
pathOfType
(
const
std
::
string
&
type
)
{
auto
iend
=
m_pathsToTypes
.
end
();
for
(
auto
it
=
m_pathsToTypes
.
begin
();
it
!=
iend
;
++
it
)
{
if
(
type
==
it
->
second
)
return
it
->
first
;
}
return
""
;
}
/**
/**
* @param classType A string name giving a class type
* @param classType A string name giving a class type
* @return True if the type exists in the file, false otherwise
* @return True if the type exists in the file, false otherwise
...
...
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