@@ -837,8 +837,6 @@ std::string WsjcppCore::extractURLProtocol(const std::string& sValue) {
837837 return sRet ;
838838}
839839
840- // ---------------------------------------------------------------------
841-
842840bool WsjcppCore::getEnv (const std::string& sName , std::string& sValue ) {
843841 if (const char * env_p = std::getenv (sName .c_str ())) {
844842 sValue = std::string (env_p);
@@ -847,8 +845,6 @@ bool WsjcppCore::getEnv(const std::string& sName, std::string& sValue) {
847845 return false ;
848846}
849847
850- // ---------------------------------------------------------------------
851-
852848std::string WsjcppCore::encodeUriComponent (const std::string& sValue ) {
853849 std::stringstream ssRet;
854850 for (int i = 0 ; i < sValue .length (); i++) {
@@ -867,8 +863,6 @@ std::string WsjcppCore::encodeUriComponent(const std::string& sValue) {
867863 return ssRet.str ();
868864}
869865
870- // ---------------------------------------------------------------------
871-
872866std::string WsjcppCore::decodeUriComponent (const std::string& sValue ) {
873867 std::string sRet = " " ;
874868 std::string sHex = " " ;
@@ -892,8 +886,6 @@ std::string WsjcppCore::decodeUriComponent(const std::string& sValue) {
892886 return sRet ;
893887}
894888
895- // ---------------------------------------------------------------------
896-
897889std::string WsjcppCore::getHumanSizeBytes (long nBytes) {
898890 if (nBytes == 0 ) {
899891 return " 0B" ;
@@ -917,8 +909,6 @@ std::string WsjcppCore::getHumanSizeBytes(long nBytes) {
917909 return std::to_string (nBytes) + " PB" ;
918910}
919911
920- // ---------------------------------------------------------------------
921-
922912bool WsjcppCore::recoursiveCopyFiles (const std::string& sSourceDir , const std::string& sTargetDir ) {
923913 if (!WsjcppCore::dirExists (sSourceDir )) {
924914 WsjcppLog::err (" recoursiveCopyFiles" , " Source Dir '" + sSourceDir + " ' did not exists" );
@@ -959,8 +949,6 @@ bool WsjcppCore::recoursiveCopyFiles(const std::string& sSourceDir, const std::s
959949 return true ;
960950}
961951
962- // ---------------------------------------------------------------------
963-
964952bool WsjcppCore::recoursiveRemoveDir (const std::string& sDir ) {
965953 if (!WsjcppCore::dirExists (sDir )) {
966954 WsjcppLog::err (" recoursiveCopyFiles" , " Dir '" + sDir + " ' did not exists" );
@@ -989,8 +977,6 @@ bool WsjcppCore::recoursiveRemoveDir(const std::string& sDir) {
989977 return true ;
990978}
991979
992- // ---------------------------------------------------------------------
993-
994980bool WsjcppCore::setFilePermissions (const std::string& sFilePath , const WsjcppFilePermissions &filePermissions, std::string& sError ) {
995981
996982 mode_t m = 0x0 ;
@@ -1017,8 +1003,6 @@ bool WsjcppCore::setFilePermissions(const std::string& sFilePath, const WsjcppFi
10171003 return true ;
10181004}
10191005
1020- // ---------------------------------------------------------------------
1021-
10221006bool WsjcppCore::getFilePermissions (const std::string& sFilePath , WsjcppFilePermissions &filePermissions, std::string& sError ) {
10231007 if (!WsjcppCore::fileExists (sFilePath )) {
10241008 sError = " File '" + sFilePath + " ' - not found" ;
@@ -1054,8 +1038,6 @@ bool WsjcppCore::getFilePermissions(const std::string& sFilePath, WsjcppFilePerm
10541038 return true ;
10551039}
10561040
1057- // ---------------------------------------------------------------------
1058-
10591041std::string WsjcppCore::doPadLeft (const std::string& sIn , char cWhat, size_t nLength) {
10601042 std::string sRet ;
10611043 size_t nPadLen = nLength - sIn .length ();
@@ -1065,8 +1047,6 @@ std::string WsjcppCore::doPadLeft(const std::string& sIn, char cWhat, size_t nLe
10651047 return sRet + sIn ;
10661048}
10671049
1068- // ---------------------------------------------------------------------
1069-
10701050std::string WsjcppCore::doPadRight (const std::string& sIn , char cWhat, size_t nLength) {
10711051 std::string sRet ;
10721052 size_t nPadLen = nLength - sIn .length ();
@@ -1076,6 +1056,18 @@ std::string WsjcppCore::doPadRight(const std::string& sIn, char cWhat, size_t nL
10761056 return sIn + sRet ;
10771057}
10781058
1059+ bool WsjcppCore::startsWith (const std::string& sLine , const std::string& sStart ) {
1060+ return sLine .rfind (sStart , 0 ) == 0 ;
1061+ }
1062+
1063+ bool WsjcppCore::endsWith (const std::string& sLine , const std::string& sEnd ) {
1064+ // https://www.techiedelight.com/check-if-a-string-ends-with-another-string-in-cpp/
1065+ if (sLine .length () < sEnd .length ()) {
1066+ return false ;
1067+ }
1068+ return std::equal (sEnd .rbegin (), sEnd .rend (), sLine .rbegin ());
1069+ }
1070+
10791071// ---------------------------------------------------------------------
10801072// WsjcppLog
10811073
@@ -1269,7 +1261,6 @@ const std::vector<WsjcppResourceFile*> &WsjcppResourcesManager::list() {
12691261 return *g_pWsjcppResourceFiles;
12701262}
12711263
1272- // ---------------------------------------------------------------------
12731264
12741265/*
12751266bool WsjcppResourcesManager::make(const std::string &sWorkspace) {
0 commit comments