Cleanup: indentation of public/protected/private keywords

This commit is contained in:
Twan van Laarhoven
2020-05-12 21:57:37 +02:00
parent 86aec577a2
commit 0c3712b61a
167 changed files with 751 additions and 752 deletions
+25 -25
View File
@@ -27,7 +27,7 @@ String card_rarity_code(const String& rarity);
/// Callback for updating a progress bar
class WithProgress {
public:
public:
virtual void onProgress(float progress, const String& message) = 0;
virtual ~WithProgress () {}
};
@@ -37,7 +37,7 @@ class AbortException {};
/// A dialog to show the progress of exporting
class ExportProgressDialog : public wxProgressDialog, public WithProgress {
public:
public:
ExportProgressDialog(Window* parent, const String& title, const String& message);
/// Update the progress bar
@@ -60,7 +60,7 @@ void ExportProgressDialog::onProgress(float progress, const String& message) {
/// An Apprentice database file, has read() and write() functions
class ApprDatabase {
public:
public:
ApprDatabase(WithProgress* progress_target, const String& name);
virtual ~ApprDatabase();
@@ -71,13 +71,13 @@ class ApprDatabase {
/// Finalize the writing, swap the actual and the temporary file
void commit();
protected:
protected:
virtual void doRead(wxInputStream&) = 0;
virtual void doWrite(wxOutputStream&) = 0;
WithProgress* progress_target; ///< Write progress information to here
private:
private:
bool in_progress; ///< Is writing in progress?
String filename; ///< Filename of database file
};
@@ -92,7 +92,7 @@ ApprDatabase::~ApprDatabase() {
// An exception is thrown while we were writing, clean up the temporary files
if (in_progress) {
// abort 'transaction'
wxRemoveFile(filename + _(".new"));
remove_file(filename + _(".new"));
}
}
@@ -106,7 +106,7 @@ void ApprDatabase::read() {
void ApprDatabase::write() {
// write to a .new file, doesn't commit yet
if (wxFileExists(filename + _(".new"))) {
wxRemoveFile(filename + _(".new"));
remove_file(filename + _(".new"));
}
wxFileOutputStream out(filename + _(".new"));
in_progress = true;
@@ -128,15 +128,15 @@ void ApprDatabase::commit() {
/// An Apprentice expansion database (Expan.dat)
class ApprExpansionDatabase : public ApprDatabase {
public:
public:
inline ApprExpansionDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("Expan.dat"))
{}
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
public:
public:
map<String,String> expansions; ///< code -> name
vector<String> order; ///< order of codes
};
@@ -181,25 +181,25 @@ void ApprExpansionDatabase::doWrite(wxOutputStream& out) {
// ----------------------------------------------------------------------------- : Format database
class ApprFormat {
public:
public:
ApprFormat(const String& name) : name(name) {}
String name, sets;
};
/// An Apprentice format database (Format.dat)
class ApprFormatDatabase : public ApprDatabase {
public:
public:
inline ApprFormatDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("Format.dat"))
{}
/// Remove a set code from all formats
void removeSet(const String& code);
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
private:
private:
vector<ApprFormat> formats;
};
@@ -253,7 +253,7 @@ void ApprFormatDatabase::doWrite(wxOutputStream& out) {
// An entry in the Distro database
class ApprDistro {
public:
public:
inline ApprDistro(int bc = 0, int bu = 0, int br = 0, int sc = 0, int su = 0, int sr = 0)
: bc(bc), bu(bu), br(br)
, sc(sc), su(su), sr(sr)
@@ -266,24 +266,24 @@ class ApprDistro {
void write(const String& code, wxTextOutputStream& tout);
private:
private:
void writeD(wxTextOutputStream& tout, const String& name, int c, int u, int r);
};
/// An Apprentice distribution database (Distro.dat)
class ApprDistroDatabase : public ApprDatabase {
public:
public:
inline ApprDistroDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("Distro.dat"))
{}
/// Remove a set code
void removeSet(const String& code);
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
public:
public:
map<String,ApprDistro> distros;
vector<String> order; // order of codes
};
@@ -357,18 +357,18 @@ DECLARE_POINTER_TYPE(ApprCardRecord);
/// An Apprentice card database (cardinfo.dat)
class ApprCardDatabase : public ApprDatabase {
public:
public:
inline ApprCardDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("sets\\cardinfo.dat"))
{}
/// Remove a set code
void removeSet(const String& code);
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
public:
public:
vector<ApprCardRecordP> cards;
};
@@ -377,7 +377,7 @@ class ApprCardDatabase : public ApprDatabase {
* and a head record at the bottom
*/
class ApprCardRecord : public IntrusivePtrBase<ApprCardRecord> {
public:
public:
String name, sets;
String type, cc, pt, text, flavor;
UInt data_pos;
@@ -579,13 +579,13 @@ void ApprCardDatabase::doWrite(wxOutputStream& out) {
/// Dialog for exporting a set to Apprentice
class ApprenticeExportWindow : public wxDialog, public WithProgress {
public:
public:
ApprenticeExportWindow(Window* parent, const SetP& set);
virtual void onProgress(float p, const String& message);
void doStep(const String& s, float size);
private:
private:
DECLARE_EVENT_TABLE();
SetP set;
+3 -3
View File
@@ -19,7 +19,7 @@ DECLARE_POINTER_TYPE(Keyword);
/// The data format for cards on the clipboard
class CardsDataObject : public wxTextDataObject {
public:
public:
/// Name of the format of MSE cards
static wxDataFormat format;
@@ -36,7 +36,7 @@ class CardsDataObject : public wxTextDataObject {
/// The data format for keywords on the clipboard
class KeywordDataObject : public wxTextDataObject {
public:
public:
/// Name of the format of MSE keywords
static wxDataFormat format;
@@ -52,7 +52,7 @@ class KeywordDataObject : public wxTextDataObject {
/// A DataObject for putting one or more cards on the clipboard, in multiple formats
class CardsOnClipboard : public wxDataObjectComposite {
public:
public:
CardsOnClipboard(const SetP& set, const vector<CardP>& cards);
};
+1 -1
View File
@@ -20,7 +20,7 @@ DECLARE_POINTER_TYPE(Card);
/// A filter for a specific file format
class FileFormat : public IntrusivePtrVirtualBase {
public:
public:
virtual ~FileFormat() {}
/// File extension used by this file format
virtual String extension() = 0;
+2 -2
View File
@@ -25,12 +25,12 @@ void export_image(const SetP& set, const CardP& card, const String& filename) {
}
class UnzoomedDataViewer : public DataViewer {
public:
public:
UnzoomedDataViewer(bool use_zoom_settings)
: use_zoom_settings(use_zoom_settings)
{}
virtual Rotation getRotation() const;
private:
private:
bool use_zoom_settings;
};
Rotation UnzoomedDataViewer::getRotation() const {
+1 -1
View File
@@ -21,7 +21,7 @@
/// The file format of MSE1 files
class MSE1FileFormat : public FileFormat {
public:
public:
virtual String extension() { return _("mse"); }
virtual String name() { return _("Magic Set Editor version 1 files (*.mse)"); }
virtual bool canImport() { return true; }
+1 -1
View File
@@ -15,7 +15,7 @@
/// The file format of MSE2 files
class MSE2FileFormat : public FileFormat {
public:
public:
virtual String extension() { return _("mse-set"); }
virtual String matches() { return _("*.mse-set;set"); }
virtual String name() { return _("Magic Set Editor sets (*.mse-set)"); }
+2 -2
View File
@@ -22,13 +22,13 @@
/// The file format of Mtg Editor files
class MtgEditorFileFormat : public FileFormat {
public:
public:
virtual String extension() { return _("set"); }
virtual String name() { return _("Mtg Editor files (*.set)"); }
virtual bool canImport() { return true; }
virtual bool canExport(const Game&) { return false; }
virtual SetP importSet(const String& filename);
private:
private:
// Filter: se filename -> image directory
// based on MtgEditor's: CardSet.getImageFolder
String filter1(const String& str);