⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wy_uty.h

📁 一个不错
💻 H
字号:
/* Copyright is licensed under GNU LGPL.                 by I.J.Wang 2005   Utilities for library/program development   Note: Support single arithmetic type (except char, it seemd have to)         For arithmetic type t, f<< t, and f<< Wy::wrd(t) are both allowed*/#ifndef WY_UTY_H__#define WY_UTY_H__#define WY_UTY_VERSION 31#include "wystr.h"#include "wynum.h"#include "wybyteflow.h"namespace Wy {  // [Evaluating]  WyRet gethostname(WyStr& buf);WyRet full_read(WyByteFlow& bf, void* buf, size_t blen, size_t& n_read);WyRet full_read(WyByteFlow& bf, WyStr& buf, size_t count);WyRet full_write(WyByteFlow& bf, const void* buf, size_t blen, size_t& n_wr);inline WyRet full_write(WyByteFlow& bf, const WyStr& str, size_t& n_wr)  { return full_write(bf,str.begin(),str.size(),n_wr); };inline WyRet full_write(WyByteFlow& bf, const WyCSeg& cs, size_t& n_wr)  { return full_write(bf,cs.begin(),cs.size(),n_wr); };};  // end Wy// [Syn] Operator<< overload//       Write bytes indicated by the right-hand side argument to the//       left-hand side WyByteFlow object.// WyByteFlow& operator <<(WyByteFlow& bf, const WyStr& str);WyByteFlow& operator <<(WyByteFlow& bf, WyCSeg str);WyByteFlow& operator <<(WyByteFlow& bf, const char* cstr);WyByteFlow& operator <<(WyByteFlow& bf, char* cstr);WyByteFlow& operator <<(WyByteFlow& bf, char ch);WyByteFlow& operator <<(WyByteFlow& bf, const void* p);// [Syn] Operator<< overload//       Convert the right-hand side arithmetic type argument to radix 10 //       string representation and write to the left-hand side WyByteFlow//       object.// WyByteFlow& operator <<(WyByteFlow&, signed char num);WyByteFlow& operator <<(WyByteFlow&, signed short num);WyByteFlow& operator <<(WyByteFlow&, signed int num);WyByteFlow& operator <<(WyByteFlow&, signed long num);WyByteFlow& operator <<(WyByteFlow&, signed long long num);WyByteFlow& operator <<(WyByteFlow&, unsigned char num);WyByteFlow& operator <<(WyByteFlow&, unsigned short num);WyByteFlow& operator <<(WyByteFlow&, unsigned int num);WyByteFlow& operator <<(WyByteFlow&, unsigned long num);WyByteFlow& operator <<(WyByteFlow&, unsigned long long num);WyByteFlow& operator <<(WyByteFlow&, float);WyByteFlow& operator <<(WyByteFlow&, double);//WyByteFlow& operator <<(WyByteFlow&, const void* p);// [Syn] Operator>> overload//       Read data from the left-hand side WyByteFlow object and store into//       the right-hand side object//WyByteFlow& operator >>(WyByteFlow& bf, WyStr& str);WyByteFlow& operator >>(WyByteFlow& bf, char& ch);inline WyByteFlow& operator >>(WyByteFlow& bf, unsigned char& ch)     { return operator>>(bf,(char&)ch); };inline WyByteFlow& operator >>(WyByteFlow& bf, signed char& ch)     { return operator>>(bf,(char&)ch); };#endif  // end of WY_UTY_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -