PageRenderTime 25ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/src/common/config/PathConfig.cpp

https://gitlab.com/github-cloud-corporation/cynara
C++ | 98 lines | 61 code | 14 blank | 23 comment | 0 complexity | ed6ddba8292b83c66fb7bf38236baca5 MD5 | raw file
  1. /*
  2. * Copyright (c) 2014-2016 Samsung Electronics Co., Ltd All Rights Reserved
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * @file src/common/config/PathConfig.cpp
  18. * @author Zofia Abramowska <z.abramowska@samsung.com>
  19. * @author Aleksander Zdyb <a.zdyb@samsung.com>
  20. * @version 1.0
  21. * @brief This file specifies PathConfig namespace containing values of default cynara paths
  22. */
  23. #include "PathConfig.h"
  24. namespace Cynara {
  25. namespace PathConfig {
  26. //main paths
  27. const std::string statePath(
  28. #ifdef LOCAL_STATE_DIR
  29. LOCAL_STATE_DIR "/cynara/"
  30. #else
  31. "/var/cynara/"
  32. #endif
  33. );
  34. const std::string libraryPath(
  35. #ifdef LIB_DIR
  36. LIB_DIR "/cynara/"
  37. #else
  38. "/usr/lib/cynara/"
  39. #endif
  40. );
  41. const std::string clientPath(
  42. #ifdef SOCKET_DIR
  43. SOCKET_DIR "/"
  44. #else
  45. "/tmp/"
  46. #endif
  47. );
  48. const std::string confPath(
  49. #ifdef SYS_CONFIG_DIR
  50. SYS_CONFIG_DIR "/cynara/"
  51. #else
  52. "/etc/cynara/"
  53. #endif
  54. );
  55. const std::string testsPath(
  56. #ifdef DATA_ROOT_DIR
  57. DATA_ROOT_DIR "/cynara/tests/"
  58. #else
  59. "/usr/share/cynara/tests/"
  60. #endif
  61. );
  62. namespace SocketPath {
  63. const std::string client(clientPath + "cynara.socket");
  64. const std::string admin(clientPath + "cynara-admin.socket");
  65. const std::string agent(clientPath + "cynara-agent.socket");
  66. const std::string monitorGet(clientPath + "cynara-monitor-get.socket");
  67. } // namespace SocketPath
  68. namespace StoragePath {
  69. const std::string dbDir(statePath + "db/");
  70. const std::string lockFile(statePath);
  71. const std::string indexFilename("buckets");
  72. const std::string guardFilename("guard");
  73. const std::string checksumFilename("checksum");
  74. const std::string backupFilenameSuffix("~");
  75. const std::string bucketFilenamePrefix("_");
  76. const char fieldSeparator(';');
  77. const char recordSeparator('\n');
  78. } // namespace StoragePath
  79. namespace PluginPath {
  80. const std::string clientDir(libraryPath + "plugin/client/");
  81. const std::string serviceDir(libraryPath + "plugin/service/");
  82. } // namespace PluginPath
  83. } // namespace PathConfig
  84. } // namespace Cynara