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
36 * Determine the data path.
38 * @return true on success, false if no data path could be found
44 * Release resources obtained by InitialiseDataPath().
47 DeinitialiseDataPath();
50 * Create the primary data path;
56 * Overrides the detected primary data path.
59 SetPrimaryDataPath(const TCHAR
*path
);
62 * Returns the absolute path of the primary data directory.
68 * Returns the path of the XCSoarData folder, optionally including
70 * @param buffer Output buffer
71 * @param file optional filename to include in the output
73 void LocalPath(TCHAR
* buf
, const TCHAR
*file
);
76 LocalPath(TCHAR
*buffer
, const TCHAR
*subdir
, const TCHAR
*name
);
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).
85 RelativePath(const TCHAR
*path
);
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
93 ExpandLocalPath(TCHAR
*dest
, const TCHAR
*src
);
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
);