文件名称: 
C++ 模板写的短小字符串类,用于替换字符数组和std::string 
     
       
      
 
       
         
         
          开发工具:  
        
 
         
          文件大小: 9kb
        
 
         
          下载次数: 0
        
 
         
          上传时间: 2020-03-11
        
 
         
        
      
    
    
     
 详细说明://短小字符串类
template
struct TinyString   
{
    TinyString();
    template 
    TinyString(const TinyString& str);
    TinyString(size_t n, char c);
    TinyString(const char* s, size_t n=0);
    TinyString(const std::string& str);
    
    template
    TinyString& operator = (const TinyString& str);
    TinyString& operator = (const std::string& str);
    TinyString& operator = (const char* s);
    TinyString& operator = (char ch);
    template
    TinyString& operator += (const TinyString& other);
    bool empty() const      { return len == 0; }
    int size() const        { return len; }
    int obj_size() const    { return sizeof(*this); }
    const char* GetData()const    { return buffer; }
    const char* c_str()const    { return buffer; }
    bool operator == (const TinyString& other) const;
    bool operator < (const TinyString& other) const;
    operator std::string() const;   //转为字符串
    std::string ToString()const;    //转为字符串
    template
    friend std::ostream & operator<< (std::ostream& os, const TinyString& str);
    template
    friend bool operator == (const TinyString& s1, const TinyString& s2);
    //......
    
    uint8_t len;
    char    buffer[N-1];
};
typedef TinyString<8>       TinyStr8;
typedef TinyString<16>      TinyStr16;
typedef TinyString<32>      TinyStr32;
typedef TinyString<1024>    TinyStr1K;
typedef TinyString<4096>    TinyStr4K;
    
 
(系统自动生成,下载前可以参看下载内容)
下载文件列表
 
 
	
 
		
			相关说明
			
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
 
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
 
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
 
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
 
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
 
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.