]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.h
fix partial (206 and 416) support in https
[apt.git] / apt-pkg / aptconfiguration.h
index b6650e20cee72bf28b488903dd1f4b1506bf314f..d22b675c015ed8dff4ebf268e99995bf414b0032 100644 (file)
@@ -13,6 +13,7 @@
 // Include Files                                                       /*{{{*/
 #include <string>
 #include <vector>
+#include <limits>
                                                                        /*}}}*/
 namespace APT {
 class Configuration {                                                  /*{{{*/
@@ -36,7 +37,7 @@ public:                                                                       /*{{{*/
         *  \param Cached saves the result so we need to calculated it only once
         *                this parameter should ony be used for testing purposes.
         *
-        *  \return a vector of (all) Language Codes in the prefered usage order
+        *  \return a vector of the compression types in the prefered usage order
         */
        std::vector<std::string> static const getCompressionTypes(bool const &Cached = true);
 
@@ -64,7 +65,15 @@ public:                                                                      /*{{{*/
         *  \return a vector of (all) Language Codes in the prefered usage order
         */
        std::vector<std::string> static const getLanguages(bool const &All = false,
-                       bool const &Cached = true, char const * const Locale = 0);
+                       bool const &Cached = true, char const ** const Locale = 0);
+
+       /** \brief Are we interested in the given Language?
+        *
+        *  \param Lang is the language we want to check
+        *  \param All defines if we check against all codes or only against used codes
+        *  \return true if we are interested, false otherwise
+        */
+       bool static const checkLanguage(std::string Lang, bool const All = false);
 
        /** \brief Returns a vector of Architectures we support
         *
@@ -82,6 +91,35 @@ public:                                                                      /*{{{*/
         */
        bool static const checkArchitecture(std::string const &Arch);
 
+       /** \brief Representation of supported compressors */
+       struct Compressor {
+               std::string Name;
+               std::string Extension;
+               std::string Binary;
+               std::vector<std::string> CompressArgs;
+               std::vector<std::string> UncompressArgs;
+               unsigned short Cost;
+
+               Compressor(char const *name, char const *extension, char const *binary,
+                          char const *compressArg, char const *uncompressArg,
+                          unsigned short const cost);
+               Compressor() : Cost(std::numeric_limits<unsigned short>::max()) {};
+       };
+
+       /** \brief Return a vector of Compressors supported for data.tar's
+        *
+        *  \param Cached saves the result so we need to calculated it only once
+        *                this parameter should ony be used for testing purposes.
+        *
+        *  \return a vector of Compressors
+        */
+       std::vector<Compressor> static const getCompressors(bool const Cached = true);
+
+       /** \brief Return a vector of extensions supported for data.tar's */
+       std::vector<std::string> static const getCompressorExtensions();
+                                                                       /*}}}*/
+       private:                                                        /*{{{*/
+       void static setDefaultConfigurationForCompressors();
                                                                        /*}}}*/
 };
                                                                        /*}}}*/