File: DesktopEntryExecValue.h

package info (click to toggle)
xdg-utils-cxx 1.0.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 456 kB
  • sloc: cpp: 2,461; ansic: 10; makefile: 6
file content (57 lines) | stat: -rw-r--r-- 1,380 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once

// system
#include <memory>
#include <string>

namespace XdgUtils {
    namespace DesktopEntry {
        /**
         * Utility class to handle values from the 'DesktopEntry/Exec' key in Desktop Entries.
         * More details at: https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html
         */
        class DesktopEntryExecValue {
        public:
            DesktopEntryExecValue();

            explicit DesktopEntryExecValue(const std::string& value);

            virtual ~DesktopEntryExecValue();

            /**
             * @return total of strings contained
             */
            unsigned long size() const;

            /**
             * Access string at <o>
             * @param i
             * @return string
             */
            std::string& operator[](int i);

            /**
             * @return string list raw representation to be set on the DesktopEntry
             */
            std::string dump();


            /**
             * Append <string> at the end of the list
             * @param string
             */
            void append(const std::string& string);

            /**
             * Remove item at <pos>
             * @param pos
             */
            void remove(int pos);

        private:
            struct Priv;
            std::unique_ptr<Priv> priv;
        };
    }
}