git-svn-id: svn://db.shs.com.ru/pip@6 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2015-02-28 18:37:44 +00:00
parent 02fdf8b415
commit 0891d1ba2d
319 changed files with 10557 additions and 0 deletions

36
doc/examples/picout.cpp Normal file
View File

@@ -0,0 +1,36 @@
#include "pip.h"
//! [own]
inline PICout operator <<(PICout s, const PIByteArray & ba) {
s.space(); // insert space after previous output
s.quote(); // ONLY if you want to quoted your type
s.setControl(0, true); // clear all features and
// save them to stack,
// now it`s behavior similar to std::cout
// your output
for (uint i = 0; i < ba.size(); ++i)
s << ba[i];
s.restoreControl(); // restore features from stack
s.quote(); // ONLY if you want to quoted your type
return s;
}
//! [own]
void _() {
//! [0]
int a = 10, b = 32, c = 11;
piCout << a << Hex << b << Bin << c;
// 10 20 1011
piCout << "this" << "is" << Green << "green" << Default << "word";
// this is green word
PICout(AddSpaces | AddNewLine | AddQuotes) << Tab << "tab and" << "quotes";
// "tab and" "quotes"
//! [0]
};