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
285a5a8f
Commit
285a5a8f
authored
13 years ago
by
Roman Tolchenov
Browse files
Options
Downloads
Patches
Plain Diff
Searching for both upper and lower case filenames. re #2392
parent
3734248a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/API/src/FileFinder.cpp
+26
-17
26 additions, 17 deletions
Code/Mantid/Framework/API/src/FileFinder.cpp
with
26 additions
and
17 deletions
Code/Mantid/Framework/API/src/FileFinder.cpp
+
26
−
17
View file @
285a5a8f
...
...
@@ -264,12 +264,18 @@ namespace Mantid
extensions
.
assign
(
facility_extensions
.
begin
(),
facility_extensions
.
end
());
}
std
::
vector
<
std
::
string
>
filenames
(
2
,
filename
);
std
::
transform
(
filename
.
begin
(),
filename
.
end
(),
filenames
[
0
].
begin
(),
toupper
);
std
::
transform
(
filename
.
begin
(),
filename
.
end
(),
filenames
[
1
].
begin
(),
tolower
);
std
::
vector
<
std
::
string
>::
const_iterator
ext
=
extensions
.
begin
();
for
(;
ext
!=
extensions
.
end
();
++
ext
)
{
std
::
string
path
=
getFullPath
(
filename
+
*
ext
);
if
(
!
path
.
empty
())
return
path
;
for
(
size_t
i
=
0
;
i
<
filenames
.
size
();
++
i
)
{
std
::
string
path
=
getFullPath
(
filenames
[
i
]
+
*
ext
);
if
(
!
path
.
empty
())
return
path
;
}
}
// Search the archive of the default facility
...
...
@@ -287,23 +293,26 @@ namespace Mantid
std
::
vector
<
std
::
string
>::
const_iterator
ext
=
extensions
.
begin
();
for
(;
ext
!=
extensions
.
end
();
++
ext
)
{
path
=
arch
->
getPath
(
filename
+
*
ext
);
Poco
::
Path
pathPattern
(
path
);
if
(
ext
->
find
(
"*"
)
!=
std
::
string
::
npos
)
{
continue
;
std
::
set
<
std
::
string
>
files
;
Kernel
::
Glob
::
glob
(
pathPattern
,
files
);
}
else
for
(
size_t
i
=
0
;
i
<
filenames
.
size
();
++
i
)
{
Poco
::
File
file
(
pathPattern
);
if
(
file
.
exists
())
path
=
arch
->
getPath
(
filenames
[
i
]
+
*
ext
);
Poco
::
Path
pathPattern
(
path
);
if
(
ext
->
find
(
"*"
)
!=
std
::
string
::
npos
)
{
return
file
.
path
();
continue
;
std
::
set
<
std
::
string
>
files
;
Kernel
::
Glob
::
glob
(
pathPattern
,
files
);
}
}
}
else
{
Poco
::
File
file
(
pathPattern
);
if
(
file
.
exists
())
{
return
file
.
path
();
}
}
}
// i
}
// ext
}
}
return
""
;
...
...
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