android/GlueIOIOPort: fix spurious errors after IOIO baud rate change
[xcsoar.git] / src / LocalPath.hpp
blobedd14c90c9961365e7da61891f5a448a9cf18ba0
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef XCSOAR_LOCAL_PATH_HPP
25 #define XCSOAR_LOCAL_PATH_HPP
27 #include "Compiler.h"
29 #include <tchar.h>
31 namespace File {
32 class Visitor;
35 /**
36 * Determine the data path.
38 * @return true on success, false if no data path could be found
40 bool
41 InitialiseDataPath();
43 /**
44 * Release resources obtained by InitialiseDataPath().
46 void
47 DeinitialiseDataPath();
49 /**
50 * Create the primary data path;
52 void
53 CreateDataPath();
55 /**
56 * Overrides the detected primary data path.
58 void
59 SetPrimaryDataPath(const TCHAR *path);
61 /**
62 * Returns the absolute path of the primary data directory.
64 const TCHAR *
65 GetPrimaryDataPath();
67 /**
68 * Returns the path of the XCSoarData folder, optionally including
69 * the given file name
70 * @param buffer Output buffer
71 * @param file optional filename to include in the output
73 void LocalPath(TCHAR* buf, const TCHAR *file);
75 TCHAR *
76 LocalPath(TCHAR *buffer, const TCHAR *subdir, const TCHAR *name);
78 /**
79 * Return the portion of the specified path that is relative to the
80 * primary data path. Returns NULL on failure (if the path is not
81 * inside the primary data path).
83 gcc_pure
84 const TCHAR *
85 RelativePath(const TCHAR *path);
87 /**
88 * Converts a file path by replacing %LOCAL_PATH% with the full pathname to
89 * the XCSoarData folder
90 * @param filein Pointer to the string to convert
92 void
93 ExpandLocalPath(TCHAR *dest, const TCHAR *src);
95 /**
96 * Converts a file path from full pathname to a shorter version with the
97 * XCSoarData folder replaced by %LOCAL_PATH%
98 * @param filein Pointer to the string to convert
100 void ContractLocalPath(TCHAR* filein);
102 void VisitDataFiles(const TCHAR* filter, File::Visitor &visitor);
104 #endif