1 #ifndef __CONSOLE_HPP__ 2 #define __CONSOLE_HPP__ 106 WORD _wPrevAttributes;
116 template <
typename _VarType >
124 _VarType &
val()
const {
return _v; }
130 template <
typename _VarType >
131 inline std::ostream & operator << ( std::ostream & out, ConsoleAttrT<_VarType>
const & tr )
139 template <
typename _VarType >
148 template <
typename _VarType >
149 inline std::wostream & operator << ( std::wostream & out, ConsoleAttrT<_VarType>
const & tr )
157 template <
typename _VarType >
167 template <
typename _VarType >
184 template <
typename _ChTy >
185 inline static void OutputV( std::basic_ostream<_ChTy> & out )
189 template <
typename _ChTy,
typename _Ty,
typename... _ArgType >
190 inline static void OutputV( std::basic_ostream<_ChTy> & out, _Ty&& a, _ArgType&& ... arg )
192 out << std::forward<_Ty>(a);
193 OutputV<_ChTy>( out, std::forward<_ArgType>(arg)... );
196 template <
typename... _ArgType >
201 #if defined(_UNICODE) || defined(UNICODE) 202 OutputV( std::wcout, std::forward<_ArgType>(arg)... );
204 OutputV( std::cout, std::forward<_ArgType>(arg)... );
207 #if defined(_UNICODE) || defined(UNICODE) 208 std::wcout << std::endl;
210 std::cout << std::endl;
214 template <
typename... _ArgType >
219 #if defined(_UNICODE) || defined(UNICODE) 220 OutputV( std::wcout, std::forward<_ArgType>(arg)... );
222 OutputV( std::cout, std::forward<_ArgType>(arg)... );
242 #endif // __CONSOLE_HPP__ XString< char > AnsiString
ConsoleAttrT(winux::ushort attr, _VarType const &v, bool isSetBgColor=false)
static void ColorOutputLine(winux::ConsoleAttr const &ca, _ArgType &&...arg)
static void ColorOutput(winux::ConsoleAttr const &ca, _ArgType &&...arg)
std::istream & operator>>(std::istream &in, ConsoleAttrT< _VarType > const &tr)
#define DISABLE_OBJECT_COPY(clsname)
ConsoleColorAttrFlags
颜色属性标记
ConsoleAttrT< _VarType > ConsoleColor(winux::ushort attr, _VarType const &v, bool isSetBgColor=false)
控制台颜色函数
ConsoleTextLayoutAlignment
文本对齐方式
#define WINUX_FUNC_DECL(ret)
String ConsoleTextLayout(String const &text, size_t maxLength, ConsoleTextLayoutAlignment align=ctlaLeft, String::value_type blankCh= ' ', bool isTrunc=true, size_t ellipsis=3)
控制台文本布局,按指定长度输出文本。可以控制对齐方式,是否截断,截断省略号
static void OutputV(std::basic_ostream< _ChTy > &out)