git-svn-id: svn://db.shs.com.ru/pip@6 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
36
doc/examples/picout.cpp
Normal file
36
doc/examples/picout.cpp
Normal 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]
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user