user_options.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 */
28 
29 
30 #pragma once
31 
32 #include "project_options.h"
33 #include "opened_item.h"
34 
35 namespace clan
36 {
39 
41 {
42 public:
43  void load(const std::string &filename);
44  void save(const std::string &filename);
45  void clear();
46 
47  static std::string filename_from_solution(const std::string &solution_filename)
48  {
49  return PathHelp::combine(PathHelp::get_fullpath(solution_filename), PathHelp::get_basename(solution_filename) + ".useroptions");
50  }
51 
52  std::vector<ProjectOptions> projects;
53  std::vector<OpenedItem> opened_items;
54 };
55 
56 }
57 
void load(const std::string &filename)
static std::string combine(const std::string &part1, const std::string &part2, PathType path_type=path_type_file)
Concatenates two strings into one adding a trailing slash to first string if missing.
std::vector< ProjectOptions > projects
Definition: user_options.h:52
static std::string get_basename(const std::string &fullname, PathType path_type=path_type_file)
Returns the basename part of a fullname.
void save(const std::string &filename)
static std::string get_fullpath(const std::string &fullname, PathType path_type=path_type_file)
Returns the path including the location.
std::vector< OpenedItem > opened_items
Definition: user_options.h:53
static std::string filename_from_solution(const std::string &solution_filename)
Definition: user_options.h:47
Definition: user_options.h:40