mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-07-27 12:16:28 +02:00
C++11: N1984 auto
This commit is contained in:
parent
4be49a2d72
commit
2834e14eb5
3 changed files with 7 additions and 7 deletions
|
@ -175,7 +175,7 @@ bool Directory::up ()
|
|||
if (_data == "/")
|
||||
return false;
|
||||
|
||||
std::string::size_type slash = _data.rfind ('/');
|
||||
auto slash = _data.rfind ('/');
|
||||
if (slash == 0)
|
||||
{
|
||||
_data = "/"; // Root dir should retain the slash.
|
||||
|
|
|
@ -116,7 +116,7 @@ std::string Path::name () const
|
|||
{
|
||||
if (_data.length ())
|
||||
{
|
||||
std::string::size_type slash = _data.rfind ('/');
|
||||
auto slash = _data.rfind ('/');
|
||||
if (slash != std::string::npos)
|
||||
return _data.substr (slash + 1, std::string::npos);
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ std::string Path::parent () const
|
|||
{
|
||||
if (_data.length ())
|
||||
{
|
||||
std::string::size_type slash = _data.rfind ('/');
|
||||
auto slash = _data.rfind ('/');
|
||||
if (slash != std::string::npos)
|
||||
return _data.substr (0, slash);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ std::string Path::extension () const
|
|||
{
|
||||
if (_data.length ())
|
||||
{
|
||||
std::string::size_type dot = _data.rfind ('.');
|
||||
auto dot = _data.rfind ('.');
|
||||
if (dot != std::string::npos)
|
||||
return _data.substr (dot + 1, std::string::npos);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ std::string Path::expand (const std::string& in)
|
|||
{
|
||||
std::string copy = in;
|
||||
|
||||
std::string::size_type tilde = copy.find ("~");
|
||||
auto tilde = copy.find ("~");
|
||||
std::string::size_type slash;
|
||||
|
||||
if (tilde != std::string::npos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue