forked from premiere/premiere-libtorrent
remove unused replace_extension()
This commit is contained in:
parent
57cd2882d4
commit
e5de81a6cb
|
@ -141,7 +141,6 @@ namespace libtorrent {
|
||||||
TORRENT_EXTRA_EXPORT char const* next_path_element(char const* p);
|
TORRENT_EXTRA_EXPORT char const* next_path_element(char const* p);
|
||||||
TORRENT_EXTRA_EXPORT std::string extension(std::string const& f);
|
TORRENT_EXTRA_EXPORT std::string extension(std::string const& f);
|
||||||
TORRENT_EXTRA_EXPORT std::string remove_extension(std::string const& f);
|
TORRENT_EXTRA_EXPORT std::string remove_extension(std::string const& f);
|
||||||
TORRENT_EXTRA_EXPORT void replace_extension(std::string& f, std::string const& ext);
|
|
||||||
TORRENT_EXTRA_EXPORT bool is_root_path(std::string const& f);
|
TORRENT_EXTRA_EXPORT bool is_root_path(std::string const& f);
|
||||||
TORRENT_EXTRA_EXPORT bool compare_path(std::string const& lhs, std::string const& rhs);
|
TORRENT_EXTRA_EXPORT bool compare_path(std::string const& lhs, std::string const& rhs);
|
||||||
|
|
||||||
|
|
19
src/path.cpp
19
src/path.cpp
|
@ -531,25 +531,6 @@ namespace {
|
||||||
return f.substr(0, aux::numeric_cast<std::size_t>(ext - &f[0]));
|
return f.substr(0, aux::numeric_cast<std::size_t>(ext - &f[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
void replace_extension(std::string& f, std::string const& ext)
|
|
||||||
{
|
|
||||||
for (int i = int(f.size()) - 1; i >= 0; --i)
|
|
||||||
{
|
|
||||||
std::size_t const idx = std::size_t(i);
|
|
||||||
if (f[idx] == '/') break;
|
|
||||||
#ifdef TORRENT_WINDOWS
|
|
||||||
if (f[idx] == '\\') break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (f[idx] != '.') continue;
|
|
||||||
|
|
||||||
f.resize(idx);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
f += '.';
|
|
||||||
f += ext;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_root_path(std::string const& f)
|
bool is_root_path(std::string const& f)
|
||||||
{
|
{
|
||||||
if (f.empty()) return false;
|
if (f.empty()) return false;
|
||||||
|
|
Loading…
Reference in New Issue