1 Star 0 Fork 2

anonymous / rtsp

forked from 飞猪饭饭 / rtsp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
r_string.h 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
greenjim301 提交于 2017-10-02 12:07 . first commit
#ifndef __R_STRING_H__
#define __R_STRING_H__
#include <string.h>
class r_string
{
public:
r_string()
:m_size(0)
{
m_buf[0] = '\0';
}
r_string(const char* str, const int in_size)
: m_size(in_size)
{
memcpy(m_buf, str, in_size);
m_buf[in_size] = '\0';
}
r_string(const char* str)
{
m_size = strlen(str);
memcpy(m_buf, str, m_size);
m_buf[m_size] = '\0';
}
r_string& operator=(const r_string& r)
{
m_size = r.m_size;
memcpy(m_buf, r.m_buf, m_size);
m_buf[m_size] = '\0';
return *this;
}
void assign(const char* str, const int in_size)
{
memcpy(m_buf, str, in_size);
m_size = in_size;
m_buf[m_size] = '\0';
}
void append(const char* str, const int in_size)
{
memcpy(m_buf + m_size, str, in_size);
m_size += in_size;
m_buf[m_size] = '\0';
}
const char* c_str()
{
return m_buf;
}
char* Data()
{
return m_buf;
}
int Size()
{
return m_size;
}
private:
char m_buf[256];
int m_size;
};
#endif
1
https://gitee.com/jibamao/rtsp.git
git@gitee.com:jibamao/rtsp.git
jibamao
rtsp
rtsp
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891