| 1 |
////////////////////////////////////////////////////////////////////////////// |
| 2 |
////////////////////////////////////////////////////////////////////////////// |
| 3 |
// |
| 4 |
// copyright : (C) 2008 by Eran Ifrah |
| 5 |
// file name : browse_record.h |
| 6 |
// |
| 7 |
// ------------------------------------------------------------------------- |
| 8 |
// A |
| 9 |
// _____ _ _ _ _ |
| 10 |
// / __ \ | | | | (_) | |
| 11 |
// | / \/ ___ __| | ___| | _| |_ ___ |
| 12 |
// | | / _ \ / _ |/ _ \ | | | __/ _ ) |
| 13 |
// | \__/\ (_) | (_| | __/ |___| | || __/ |
| 14 |
// \____/\___/ \__,_|\___\_____/_|\__\___| |
| 15 |
// |
| 16 |
// F i l e |
| 17 |
// |
| 18 |
// This program is free software; you can redistribute it and/or modify |
| 19 |
// it under the terms of the GNU General Public License as published by |
| 20 |
// the Free Software Foundation; either version 2 of the License, or |
| 21 |
// (at your option) any later version. |
| 22 |
// |
| 23 |
////////////////////////////////////////////////////////////////////////////// |
| 24 |
////////////////////////////////////////////////////////////////////////////// |
| 25 |
#ifndef BROWSE_HISTORY_H |
| 26 |
#define BROWSE_HISTORY_H |
| 27 |
|
| 28 |
#include <wx/string.h> |
| 29 |
|
| 30 |
class BrowseRecord |
| 31 |
{ |
| 32 |
public: |
| 33 |
wxString filename; |
| 34 |
wxString project; |
| 35 |
int lineno = wxNOT_FOUND; |
| 36 |
int column = wxNOT_FOUND; |
| 37 |
int firstLineInView = wxNOT_FOUND; |
| 38 |
wxString ssh_account; |
| 39 |
|
| 40 |
public: |
| 41 |
BrowseRecord() {} |
| 42 |
~BrowseRecord() {} |
| 43 |
|
| 44 |
bool IsSameAs(const BrowseRecord& other) const |
| 45 |
{ |
| 46 |
return filename == other.filename && lineno == other.lineno && ssh_account == other.ssh_account; |
| 47 |
} |
| 48 |
|
| 49 |
/** |
| 50 |
* @brief having a file name is enough for a jumping record |
| 51 |
*/ |
| 52 |
bool IsOk() const { return !filename.empty(); } |
| 53 |
|
| 54 |
/** |
| 55 |
* @brief is this record for a remote file? |
| 56 |
*/ |
| 57 |
bool IsRemote() const { return !ssh_account.empty(); } |
| 58 |
|
| 59 |
/** |
| 60 |
* @brief return the ssh account associated with this record |
| 61 |
*/ |
| 62 |
const wxString& GetSshAccount() const { return ssh_account; } |
| 63 |
}; |
| 64 |
|
| 65 |
#endif // BROWSE_HISTORY_H |