X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/2830b8436ac8a6f2f3dac4ce2cd030c24eebce04..dca07c4d676ac7bbc3543dff359735c0275e90fd:/apt-pkg/contrib/strutl.h diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 5733fd6e2..3e3c2cef6 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -40,6 +40,7 @@ namespace APT { namespace String { std::string Strip(const std::string &s); bool Endswith(const std::string &s, const std::string &ending); + bool Startswith(const std::string &s, const std::string &starting); } } @@ -65,7 +66,7 @@ std::string URItoFileName(const std::string &URI); std::string TimeRFC1123(time_t Date); bool RFC1123StrToTime(const char* const str,time_t &time) APT_MUSTCHECK; bool FTPMDTMStrToTime(const char* const str,time_t &time) APT_MUSTCHECK; -APT_DEPRECATED bool StrToTime(const std::string &Val,time_t &Result); +APT_DEPRECATED_MSG("Use RFC1123StrToTime or FTPMDTMStrToTime as needed instead") bool StrToTime(const std::string &Val,time_t &Result); std::string LookupTag(const std::string &Message,const char *Tag,const char *Default = 0); int StringToBool(const std::string &Text,int Default = -1); bool ReadMessages(int Fd, std::vector &List); @@ -80,7 +81,7 @@ bool TokSplitString(char Tok,char *Input,char **List, unsigned long ListMax); // split a given string by a char -std::vector VectorizeString(std::string const &haystack, char const &split) APT_CONST; +std::vector VectorizeString(std::string const &haystack, char const &split) APT_PURE; /* \brief Return a vector of strings from string "input" where "sep" * is used as the delimiter string. @@ -152,9 +153,9 @@ inline const char *DeNull(const char *s) {return (s == 0?"(null)":s);} class URI { void CopyFrom(const std::string &From); - + public: - + std::string Access; std::string User; std::string Password; @@ -166,6 +167,7 @@ class URI inline void operator =(const std::string &From) {CopyFrom(From);} inline bool empty() {return Access.empty();}; static std::string SiteOnly(const std::string &URI); + static std::string ArchiveOnly(const std::string &URI); static std::string NoUserPassword(const std::string &URI); URI(std::string Path) {CopyFrom(Path);}