X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkUtilities.h;h=2b1b031559faf77899ab4c1d41a2bca122a815f2;hb=5e6e754f059d5fb6b25b883f89f76333228ba5c4;hp=b399867438ad95a1ffccd3f01f910f429dc307cf;hpb=f1575da9353486cb8dcc2cf260201334fbba3599;p=bbtk.git diff --git a/kernel/src/bbtkUtilities.h b/kernel/src/bbtkUtilities.h index b399867..2b1b031 100644 --- a/kernel/src/bbtkUtilities.h +++ b/kernel/src/bbtkUtilities.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkUtilities.h,v $ Language: C++ - Date: $Date: 2008/01/30 15:29:07 $ - Version: $Revision: 1.9 $ + Date: $Date: 2008/03/10 06:24:13 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -47,6 +47,7 @@ #include #endif +#include // std::toupper //#include "bbtkMessageManager.h" namespace bbtk @@ -127,7 +128,8 @@ namespace bbtk // WIN 32 mechanism // shared lib name = .dll - // remove {bb} if any +// EED Problem loading package call bbtkTools +// // remove {bb} if any if (memcmp (pkgname.c_str(), "bb", 2) == 0) { pkgname = pkgname.substr(2, pkgname.length()); } @@ -363,6 +365,29 @@ static bool IsDirectory(std::string const &dirName) right = ""; } } + //======================================================================= + static inline void SplitString ( const std::string& str, + const std::string& delimiters, + std::vector& tokens) + { + // Skip delimiters at beginning. + std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); + // Find first delimiter. + std::string::size_type pos = str.find_first_of(delimiters, lastPos); + + while (std::string::npos != pos || std::string::npos != lastPos) + { + // Found a token, add it to the vector. + tokens.push_back(str.substr(lastPos, pos - lastPos)); + // Skip delimiters. Note the "not_of" + lastPos = str.find_first_not_of(delimiters, pos); + // Find next delimiter + pos = str.find_first_of(delimiters, lastPos); + } + + } + //======================================================================= + // =================================================================================== @@ -492,15 +517,14 @@ static int Explore(std::string const &dirpath, bool recursive, std::vector", ">" ); } + + + //======================================================================== + // Usefull functions OPTIONS string //======================================================================== + + static bool loosematch(std::string stdLine,std::string stdOptions); + + + + }; + } // namespace bbtk #endif //#ifndef __bbtkUtilities_h_INCLUDED__