mark.h 785 B

1234567891011121314151617181920212223242526272829
  1. #ifndef MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
  2. #define MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
  3. #if defined(_MSC_VER) || \
  4. (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
  5. (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
  6. #pragma once
  7. #endif
  8. #include "yaml-cpp/dll.h"
  9. namespace YAML {
  10. struct YAML_CPP_API Mark {
  11. Mark() : pos(0), line(0), column(0) {}
  12. static const Mark null_mark() { return Mark(-1, -1, -1); }
  13. bool is_null() const { return pos == -1 && line == -1 && column == -1; }
  14. int pos;
  15. int line, column;
  16. private:
  17. Mark(int pos_, int line_, int column_)
  18. : pos(pos_), line(line_), column(column_) {}
  19. };
  20. }
  21. #endif // MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66