KiCad PCB EDA Suite
Loading...
Searching...
No Matches
wx_filename.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef WX_FILENAME_H
21#define WX_FILENAME_H
22
23#include <kicommon.h>
24#include <wx/filename.h>
25
35#define FN_NORMALIZE_FLAGS ( wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_ABSOLUTE | \
36 wxPATH_NORM_LONG | wxPATH_NORM_SHORTCUT )
37
46{
47public:
48 WX_FILENAME( const wxString& aPath, const wxString& aFilename );
49
50 void SetFullName( const wxString& aFileNameAndExtension );
51 void SetPath( const wxString& aPath );
52
53 wxString GetName() const;
54 wxString GetFullName() const;
55 wxString GetPath() const;
56 wxString GetFullPath() const;
57
58 // Avoid multiple calls to stat() on POSIX kernels.
59 long long GetTimestamp();
60
61 // Resolve possible symlink(s) to absolute path
62 static void ResolvePossibleSymlinks( wxFileName& aFilename );
63
64private:
65 // Write cached values to the wrapped wxFileName. MUST be called before using m_fn.
66 void resolve();
67
68 wxFileName m_fn;
69 wxString m_path;
70 wxString m_fullName;
71};
72
73#endif // WX_FILENAME_H
WX_FILENAME(const wxString &aPath, const wxString &aFilename)
void SetFullName(const wxString &aFileNameAndExtension)
static void ResolvePossibleSymlinks(wxFileName &aFilename)
wxString GetPath() const
void SetPath(const wxString &aPath)
wxString m_path
Definition wx_filename.h:69
wxFileName m_fn
Definition wx_filename.h:68
wxString GetName() const
wxString GetFullPath() const
long long GetTimestamp()
wxString GetFullName() const
wxString m_fullName
Definition wx_filename.h:70
#define KICOMMON_API
Definition kicommon.h:27