Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dmitri Naumov
ogs
Commits
0838a99f
Commit
0838a99f
authored
12 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
Style.
parent
6ccf3866
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
BaseLib/FileTools.cpp
+2
-2
2 additions, 2 deletions
BaseLib/FileTools.cpp
BaseLib/FileTools.h
+4
-2
4 additions, 2 deletions
BaseLib/FileTools.h
with
6 additions
and
4 deletions
BaseLib/FileTools.cpp
+
2
−
2
View file @
0838a99f
...
@@ -76,12 +76,12 @@ size_t findLastDot(std::string const& path)
...
@@ -76,12 +76,12 @@ size_t findLastDot(std::string const& path)
std
::
string
dropFileExtension
(
std
::
string
const
&
filename
)
std
::
string
dropFileExtension
(
std
::
string
const
&
filename
)
{
{
// Look for dots in filename.
// Look for dots in filename.
const
size_t
p
=
findLastDot
(
filename
);
const
size_t
p
=
findLastDot
(
filename
);
if
(
p
==
std
::
string
::
npos
)
if
(
p
==
std
::
string
::
npos
)
return
filename
;
return
filename
;
// Check position of the last path separator.
// Check position of the last path separator.
const
size_t
s
=
findLastPathSeparator
(
filename
);
const
size_t
s
=
findLastPathSeparator
(
filename
);
if
(
s
!=
std
::
string
::
npos
&&
p
<
s
)
if
(
s
!=
std
::
string
::
npos
&&
p
<
s
)
return
filename
;
return
filename
;
...
...
This diff is collapsed.
Click to expand it.
BaseLib/FileTools.h
+
4
−
2
View file @
0838a99f
...
@@ -72,7 +72,8 @@ std::string getFileExtension(std::string const& filename);
...
@@ -72,7 +72,8 @@ std::string getFileExtension(std::string const& filename);
* insensitive done by converting to upper case with the std::toupper()
* insensitive done by converting to upper case with the std::toupper()
* function.
* function.
*/
*/
bool
hasFileExtension
(
std
::
string
const
&
extension
,
std
::
string
const
&
filename
);
bool
hasFileExtension
(
std
::
string
const
&
extension
,
std
::
string
const
&
filename
);
/** Returns a string with file extension as found by getFileExtension()
/** Returns a string with file extension as found by getFileExtension()
* dropped.
* dropped.
...
@@ -83,7 +84,8 @@ std::string dropFileExtension(std::string const& filename);
...
@@ -83,7 +84,8 @@ std::string dropFileExtension(std::string const& filename);
* Checks if file_name already contains a qualified path and if not copies the
* Checks if file_name already contains a qualified path and if not copies the
* path from source.
* path from source.
*/
*/
std
::
string
copyPathToFileName
(
const
std
::
string
&
file_name
,
const
std
::
string
&
source
);
std
::
string
copyPathToFileName
(
const
std
::
string
&
file_name
,
const
std
::
string
&
source
);
/**
/**
* Extracts the path of a pathname.
* Extracts the path of a pathname.
...
...
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