Fix nasty infinite-loop bug in Buffer:sendCollection
[supercollider.git] / external_libraries / yaml-cpp-0.2.6 / src / indentation.h
blob89d68df1a4cde60c6f5edc16636d466be585128a
1 #ifndef INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 #define INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66
4 #if !defined(__GNUC__) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4) // GCC supports "pragma once" correctly since 3.4
5 #pragma once
6 #endif
9 #include "yaml-cpp/ostream.h"
10 #include <iostream>
12 namespace YAML
14 struct Indentation {
15 Indentation(unsigned n_): n(n_) {}
16 unsigned n;
19 inline ostream& operator << (ostream& out, const Indentation& indent) {
20 for(unsigned i=0;i<indent.n;i++)
21 out << ' ';
22 return out;
25 struct IndentTo {
26 IndentTo(unsigned n_): n(n_) {}
27 unsigned n;
30 inline ostream& operator << (ostream& out, const IndentTo& indent) {
31 while(out.col() < indent.n)
32 out << ' ';
33 return out;
38 #endif // INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66