Przeglądaj źródła

rename ExplodeString to VectorizeString

David Kalnischkies 16 lat temu
rodzic
commit
3f42500d6b

+ 1 - 1
apt-pkg/aptconfiguration.cc

@@ -221,7 +221,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 	const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE");
 	const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE");
 	string envLang = Locale == 0 ? language_env : *(Locale+1);
 	string envLang = Locale == 0 ? language_env : *(Locale+1);
 	if (envLang.empty() == false) {
 	if (envLang.empty() == false) {
-		std::vector<string> env = ExplodeString(envLang,':');
+		std::vector<string> env = VectorizeString(envLang,':');
 		short addedLangs = 0; // add a maximum of 3 fallbacks from the environment
 		short addedLangs = 0; // add a maximum of 3 fallbacks from the environment
 		for (std::vector<string>::const_iterator e = env.begin();
 		for (std::vector<string>::const_iterator e = env.begin();
 		     e != env.end() && addedLangs < 3; ++e) {
 		     e != env.end() && addedLangs < 3; ++e) {

+ 3 - 3
apt-pkg/contrib/strutl.cc

@@ -1000,12 +1000,12 @@ bool TokSplitString(char Tok,char *Input,char **List,
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/
-// ExplodeString - Split a string up into a vector			/*{{{*/
+// VectorizeString - Split a string up into a vector of strings		/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* This can be used to split a given string up into a vector, so the
 /* This can be used to split a given string up into a vector, so the
    propose is the same as in the method above and this one is a bit slower
    propose is the same as in the method above and this one is a bit slower
-   also, but the advantage is that we an iteratable vector */
-vector<string> ExplodeString(string const &haystack, char const &split)
+   also, but the advantage is that we have an iteratable vector */
+vector<string> VectorizeString(string const &haystack, char const &split)
 {
 {
    string::const_iterator start = haystack.begin();
    string::const_iterator start = haystack.begin();
    string::const_iterator end = start;
    string::const_iterator end = start;

+ 1 - 1
apt-pkg/contrib/strutl.h

@@ -52,7 +52,7 @@ bool StrToNum(const char *Str,unsigned long &Res,unsigned Len,unsigned Base = 0)
 bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length);
 bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length);
 bool TokSplitString(char Tok,char *Input,char **List,
 bool TokSplitString(char Tok,char *Input,char **List,
 		    unsigned long ListMax);
 		    unsigned long ListMax);
-vector<string> ExplodeString(string const &haystack, char const &split);
+vector<string> VectorizeString(string const &haystack, char const &split) __attrib_const;
 void ioprintf(ostream &out,const char *format,...) __like_printf(2);
 void ioprintf(ostream &out,const char *format,...) __like_printf(2);
 void strprintf(string &out,const char *format,...) __like_printf(2);
 void strprintf(string &out,const char *format,...) __like_printf(2);
 char *safe_snprintf(char *Buffer,char *End,const char *Format,...) __like_printf(3);
 char *safe_snprintf(char *Buffer,char *End,const char *Format,...) __like_printf(3);

+ 1 - 1
apt-pkg/deb/debmetaindex.cc

@@ -313,7 +313,7 @@ class debSLTypeDebian : public pkgSourceList::Type
    {
    {
       map<string, string>::const_iterator const arch = Options.find("arch");
       map<string, string>::const_iterator const arch = Options.find("arch");
       vector<string> const Archs =
       vector<string> const Archs =
-		(arch != Options.end()) ? ExplodeString(arch->second, ',') :
+		(arch != Options.end()) ? VectorizeString(arch->second, ',') :
 				APT::Configuration::getArchitectures();
 				APT::Configuration::getArchitectures();
 
 
       for (vector<metaIndex *>::const_iterator I = List.begin();
       for (vector<metaIndex *>::const_iterator I = List.begin();