#ifndef CONNECTION_DIALOG_H_E526D0E7 #define CONNECTION_DIALOG_H_E526D0E7 #include #ifndef WX_PRECOMP #include #endif #include #include class ConnectionDialog : public wxDialog { public: ConnectionDialog(); std::string GetServerValue() { return server_box_->GetValue().utf8_string(); } std::string GetPlayerValue() { return player_box_->GetValue().utf8_string(); } std::string GetPasswordValue() { return password_box_->GetValue().utf8_string(); } private: void OnOldConnectionChosen(wxCommandEvent& e); wxTextCtrl* server_box_; wxTextCtrl* player_box_; wxTextCtrl* password_box_; wxListBox* history_list_; }; #endif /* end of include guard: CONNECTION_DIALOG_H_E526D0E7 */ 'h' onchange='this.form.submit();'> Autotracker for the Lingo Archipelago integration
about summary refs log tree commit diff stats
blob: eeaab0a3c20739f080e74c876c3aa8ee688eb3a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef VERSION_H_C757E53C
#define VERSION_H_C757E53C

#include <iostream>
#include <regex>

struct Version {
  int major = 0;
  int minor = 0;
  int revision = 0;

  constexpr Version(int major_arg, int minor_arg, int rev_arg)
      : major(major_arg), minor(minor_arg), revision(rev_arg) {}

  Version(const std::string& ver_str) {
    const std::regex version_regex("v([0-9]*)\.([0-9]*)\.([0-9]*)");
    std::smatch version_match;

    if (std::regex_match(ver_str, version_match, version_regex)) {
      major = std::atoi(version_match[1].str().c_str());
      minor = std::atoi(version_match[2].str().c_str());
      revision = std::atoi(version_match[3].str().c_str());
    }
  }

  bool operator<(const Version& rhs) const {
    return (major < rhs.major) ||
           (major == rhs.major &&
            (minor < rhs.minor ||
             (minor == rhs.minor && revision < rhs.revision)));
  }
};

std::ostream& operator<<(std::ostream& out, const Version& ver) {
  return out << "v" << ver.major << "." << ver.minor << "." << ver.revision;
}

constexpr const Version kTrackerVersion = Version(0, 5, 5);

#endif /* end of include guard: VERSION_H_C757E53C */