]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.h
updating <date> tags and the po files for the manpages
[apt.git] / apt-pkg / aptconfiguration.h
index 6a123adcede9376722e6f177aa8ded1be4afc346..e098d0fd6f4ea9d3921cd1cb0a77e9e128e9f5d8 100644 (file)
@@ -13,6 +13,7 @@
 // Include Files                                                       /*{{{*/
 #include <string>
 #include <vector>
 // Include Files                                                       /*{{{*/
 #include <string>
 #include <vector>
+#include <limits>
                                                                        /*}}}*/
 namespace APT {
 class Configuration {                                                  /*{{{*/
                                                                        /*}}}*/
 namespace APT {
 class Configuration {                                                  /*{{{*/
@@ -36,9 +37,81 @@ public:                                                                      /*{{{*/
         *  \param Cached saves the result so we need to calculated it only once
         *                this parameter should ony be used for testing purposes.
         *
         *  \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);
         */
        std::vector<std::string> static const getCompressionTypes(bool const &Cached = true);
+
+       /** \brief Returns a vector of Language Codes
+        *
+        *  Languages can be defined with their two or five chars long code.
+        *  This methods handles the various ways to set the prefered codes,
+        *  honors the environment and ensures that the codes are not listed twice.
+        *
+        *  The special word "environment" will be replaced with the long and the short
+        *  code of the local settings and it will be insured that this will not add
+        *  duplicates. So in an german local the setting "environment, de_DE, en, de"
+        *  will result in "de_DE, de, en".
+        *
+        *  Another special word is "none" which separates the prefered from all codes
+        *  in this setting. So setting and method can be used to get codes the user want
+        *  to see or to get all language codes APT (should) have Translations available.
+        *
+        *  \param All return all codes or only codes for languages we want to use
+        *  \param Cached saves the result so we need to calculated it only once
+        *                this parameter should ony be used for testing purposes.
+        *  \param Locale don't get the locale from the system but use this one instead
+        *                this parameter should ony be used for testing purposes.
+        *
+        *  \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);
+
+       /** \brief Returns a vector of Architectures we support
+        *
+        *  \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 Architectures in prefered order
+        */
+       std::vector<std::string> static const getArchitectures(bool const &Cached = true);
+
+       /** \brief Are we interested in the given Architecture?
+        *
+        *  \param Arch we want to check
+        *  \return true if we are interested, false otherwise
+        */
+       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();
                                                                        /*}}}*/
 };
                                                                        /*}}}*/
                                                                        /*}}}*/
 };
                                                                        /*}}}*/