

Managing as well as querying information about packagesĪs a low-level access to all features of the libapt-pkg library. This package provides commandline tools for searching and Suggests: apt-doc, aptitude | synaptic | wajig, dpkg-dev (>= 1.17.2), gnupg | gnupg2 | gnupg1, powermgmt-baseīreaks: apt-transport-https (<< 1.5~alpha4~), apt-utils (<< 1.3~exp2~), aptitude (<< 0.8.10)ĭescription-en: commandline package manager It might be wise to make class Settings, where you can initialize platform dependent root paths once per start, and then use Settings::GetImagePath() as method.For example, for apt, the control file looks like the following:

Image *img2 = LoadImage(GetImagePath("openfile").c_str()) Image *img1 = LoadImage(GetImagePath("toolbox").c_str()) Return GetImageBasePath() + imagename + ".png" Įxtern Image * LoadImage(const char *path) you may check if such file does exist here for example and return only image type that does exist, if you can load multiple types. multiple directories and/or file types could be tried here, depends on how sophisticated Std::string GetImagePath(const std::string &imagename) Return std::string(DATA_PREFIX) + "/images" #include Ĭonst char DATA_PREFIX = ROOT_PREFIX "program/data" Ĭonst char DATA_PREFIX = ROOT_PREFIX "share/program" It depends on toolkit used, Qt library may have something similar already implemented. I suggest some functions, where you will pass name of object and they will return path of file. On windows, prefix would be sufficient also, if it should not be too flexible. On unix, place for data is more or less given, you may consider build option for changing target prefix, or use environment variable to override default paths. On windows, it depends on installer, usually programs usually have path in registry to directory where they are installed. These files are extracted on package install into target file system as real files.Įdit2: As for multiplatform solution, i suggest you make some wrapper functions.

But it is not resources like in adroid or iphone, or windows files. You may want check if packaging for Debian. Note: there is no need to "data" directory when /usr/share is already there for non-executable data. Or ~/.programname/cache.db, depends what kind of application it is and what it does. Data changed by application in /var/lib/programname/cache.db. Platform dependent code should belong into /usr/lib/programname, platform independent read-only data into /usr/share/programname/img.png. I were unable to discover any specification quickly enough.īut you should not use some "base" directory and subdirectories in it for each type of data. I think is has something to do with Linux Standard Base or POSIX specifications maybe. This is not entirely linux specific or debian specific.
