#pragma once

#define _XLOCTIME_

// Copied from the synopsis section of
// https://en.cppreference.com/w/cpp/header/locale
namespace std {

class time_base {
public:
  enum dateorder { no_order, dmy, mdy, ymd, ydm };
};

template <class CharT, class InputIter = istreambuf_iterator<CharT>>
class time_get : public locale::facet, public time_base {
public:
  typedef CharT char_type;
  typedef InputIter iter_type;

  explicit time_get(size_t refs = 0) { abort(); }

  dateorder date_order() const { abort(); }
  iter_type get_time(iter_type s, iter_type end, ios_base &f,
                     ios_base::iostate &err, tm *t) const {
    abort();
  }
  iter_type get_date(iter_type s, iter_type end, ios_base &f,
                     ios_base::iostate &err, tm *t) const {
    abort();
  }
  iter_type get_weekday(iter_type s, iter_type end, ios_base &f,
                        ios_base::iostate &err, tm *t) const {
    abort();
  }
  iter_type get_monthname(iter_type s, iter_type end, ios_base &f,
                          ios_base::iostate &err, tm *t) const {
    abort();
  }
  iter_type get_year(iter_type s, iter_type end, ios_base &f,
                     ios_base::iostate &err, tm *t) const {
    abort();
  }
  iter_type get(iter_type s, iter_type end, ios_base &f, ios_base::iostate &err,
                tm *t, char format, char modifier = 0) const {
    abort();
  }
  iter_type get(iter_type s, iter_type end, ios_base &f, ios_base::iostate &err,
                tm *t, const char_type *fmt, const char_type *fmtend) const {
    abort();
  }

  static locale::id id;

protected:
  ~time_get() { abort(); }

  virtual dateorder do_date_order() const { abort(); }
  virtual iter_type do_get_time(iter_type s, iter_type end, ios_base &,
                                ios_base::iostate &err, tm *t) const {
    abort();
  }
  virtual iter_type do_get_date(iter_type s, iter_type end, ios_base &,
                                ios_base::iostate &err, tm *t) const {
    abort();
  }
  virtual iter_type do_get_weekday(iter_type s, iter_type end, ios_base &,
                                   ios_base::iostate &err, tm *t) const {
    abort();
  }
  virtual iter_type do_get_monthname(iter_type s, iter_type end, ios_base &,
                                     ios_base::iostate &err, tm *t) const {
    abort();
  }
  virtual iter_type do_get_year(iter_type s, iter_type end, ios_base &,
                                ios_base::iostate &err, tm *t) const {
    abort();
  }
  virtual iter_type do_get(iter_type s, iter_type end, ios_base &f,
                           ios_base::iostate &err, tm *t, char format,
                           char modifier) const {
    abort();
  }
};

template <class CharT, class OutputIter = ostreambuf_iterator<CharT>>
class time_put : public locale::facet {
public:
  typedef CharT char_type;
  typedef OutputIter iter_type;

  explicit time_put(size_t refs = 0) { abort(); }

  // the following is implemented in terms of other member functions.
  iter_type put(iter_type s, ios_base &f, char_type fill, const tm *tmb,
                const CharT *pattern, const CharT *pat_end) const {
    abort();
  }
  iter_type put(iter_type s, ios_base &f, char_type fill, const tm *tmb,
                char format, char modifier = 0) const {
    abort();
  }

  static locale::id id;

protected:
  ~time_put() { abort(); }

  virtual iter_type do_put(iter_type s, ios_base &, char_type, const tm *t,
                           char format, char modifier) const {
    abort();
  }
};

} // namespace std

// vim: filetype=c
