indentation.h
Go to the documentation of this file.
1 #ifndef INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
2 #define INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
3 
4 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
5 #pragma once
6 #endif
7 
8 
9 #include "yaml-cpp-pm/ostream.h"
10 #include <iostream>
11 
12 namespace YAML_PM
13 {
14  struct Indentation {
15  Indentation(unsigned n_): n(n_) {}
16  unsigned n;
17  };
18 
19  inline ostream& operator << (ostream& out, const Indentation& indent) {
20  for(unsigned i=0;i<indent.n;i++)
21  out << ' ';
22  return out;
23  }
24 
25  struct IndentTo {
26  IndentTo(unsigned n_): n(n_) {}
27  unsigned n;
28  };
29 
30  inline ostream& operator << (ostream& out, const IndentTo& indent) {
31  while(out.col() < indent.n)
32  out << ' ';
33  return out;
34  }
35 }
36 
37 
38 #endif // INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
IndentTo(unsigned n_)
Definition: indentation.h:26
unsigned col() const
Definition: ostream.h:24
Emitter & operator<<(Emitter &emitter, const std::string &v)
Definition: emitter.h:148
Indentation(unsigned n_)
Definition: indentation.h:15


libpointmatcher
Author(s):
autogenerated on Sat May 27 2023 02:38:02