add last backwards-compatible version

This commit is contained in:
2021-12-14 00:33:46 -07:00
parent 68b10d413b
commit b0dd3f07f3
335 changed files with 4746 additions and 19627 deletions

View File

@@ -1,8 +1,5 @@
#pragma once
#include <functional>
#include "stringNew.h"
namespace pfc {
namespace io {
namespace path {
@@ -13,11 +10,6 @@ namespace pfc {
#endif
typedef std::function<const char* (char)> charReplace_t;
const char * charReplaceDefault(char);
const char * charReplaceModern(char);
string getFileName(string path);
string getFileNameWithoutExtension(string path);
string getFileExtension(string path);
@@ -28,11 +20,11 @@ namespace pfc {
string getSeparators();
bool isSeparator(char c);
string getIllegalNameChars(bool allowWC = false);
string replaceIllegalNameChars(string fn, bool allowWC = false, charReplace_t replace = charReplaceDefault);
string replaceIllegalPathChars(string fn, charReplace_t replace = charReplaceDefault);
string replaceIllegalNameChars(string fn, bool allowWC = false);
string replaceIllegalPathChars(string fn);
bool isInsideDirectory(pfc::string directory, pfc::string inside);
bool isDirectoryRoot(string path);
string validateFileName(string name, bool allowWC = false, bool preserveExt = false, charReplace_t replace = charReplaceDefault);//removes various illegal things from the name, exact effect depends on the OS, includes removal of the invalid characters
string validateFileName(string name, bool allowWC = false, bool preserveExt = false);//removes various illegal things from the name, exact effect depends on the OS, includes removal of the invalid characters
template<typename t1, typename t2> inline bool equals(const t1 & v1, const t2 & v2) {return comparator::compare(v1,v2) == 0;}