trikRuntime
paths.h
Go to the documentation of this file.
1 /* Copyright 2015 CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/QString>
18 
19 namespace trikKernel {
20 
26 class Paths
27 {
28 public:
30  static QString configsPath();
31 
33  static QString coreDumpPath();
34 
36  static QString logsPath();
37 
39  static QString mediaPath();
40 
42  static QString systemScriptsPath();
43 
45  static QString userScriptsPath();
46 
48  static QString translationsPath();
49 
51  static QString trikRcName();
52 
54  static QString localSettings();
55 
57  static QString hostnameName();
58 
59 private:
60  enum class Resource {
61  configs
62  , translations
63  , media
64  , localSettings
65  , logs
66  , coreDump
67  , userScripts
68  , systemScripts
69  };
70 
71  static QString path(const Resource &resource);
72 };
73 
74 }
Definition: analogSensor.h:23
static QString configsPath()
Path to a directory with trikControl config files.
Definition: paths.cpp:36
static QString hostnameName()
Name (with path) of hostname file.
Definition: paths.cpp:81
static QString mediaPath()
Path to a directory containing "media" folder (with images and sounds).
Definition: paths.cpp:46
static QString translationsPath()
Name of a directory containing "translations" folder.
Definition: paths.cpp:66
static QString systemScriptsPath()
Path to a directory with "system.js" file.
Definition: paths.cpp:56
static QString trikRcName()
Name (with path) of trikrc file.
Definition: paths.cpp:71
Service that provides information about file paths used by system.
Definition: paths.h:26
static QString localSettings()
Name (with path) of .ini file with local settings like locale and hull number.
Definition: paths.cpp:76
static QString userScriptsPath()
Where to put script files sent by TRIK Studio and written by user.
Definition: paths.cpp:51
static QString coreDumpPath()
Where to put core dump if something goes wrong.
Definition: paths.cpp:61
static QString logsPath()
Where to put log files.
Definition: paths.cpp:41