当前位置: 首页 > news >正文

网站想要被收录要怎么做短视频平台开发

网站想要被收录要怎么做,短视频平台开发,鼓楼区建设局网站,长沙专业网站建设服务8. 代码设计 8.1 实用类设计 提前完成⼀些零碎的功能接⼝#xff0c;以便于项⽬中会⽤到。 • 获取系统时间 • 判断⽂件是否存在 • 获取⽂件的所在⽬录路径 • 创建⽬录 /* 通⽤功能类#xff0c;与业务⽆关的功能实现1. 获取系统时间2. 获取⽂件⼤⼩3. 创建⽬录4. 获取⽂…8. 代码设计 8.1 实用类设计 提前完成⼀些零碎的功能接⼝以便于项⽬中会⽤到。 • 获取系统时间 • 判断⽂件是否存在 • 获取⽂件的所在⽬录路径 • 创建⽬录 /* 通⽤功能类与业务⽆关的功能实现1. 获取系统时间2. 获取⽂件⼤⼩3. 创建⽬录4. 获取⽂件所在⽬录 */ #ifndef __M_UTIL_H__ #define __M_UTIL_H__ #include iostream #include fstream #include sstream #include string #include ctime #include cassert #include sys/stat.h namespace bitlog{namespace util{class date {public:static size_t now() { return (size_t)time(nullptr); }};class file {public:static bool exists(const std::string name) {struct stat st;return stat(name.c_str(), st) 0;}static std::string path(const std::string name) {if (name.empty()) return .;size_t pos name.find_last_of(/\\);if (pos std::string::npos) return .;return name.substr(0, pos 1);}static void create_directory(const std::string path) { if (path.empty()) return ;if (exists(path)) return ;size_t pos, idx 0;while(idx path.size()) {pos path.find_first_of(/\\, idx);if (pos std::string::npos) {mkdir(path.c_str(), 0755);return;}if (pos idx) {idx pos 1; continue;}std::string subdir path.substr(0, pos);if (subdir . || subdir ..){idx pos 1; continue;}if (exists(subdir)) {idx pos 1; continue;}mkdir(subdir.c_str(), 0755);idx pos 1;}}};} } #endif8.2 日志等级类设计 日志等级总共分为7个等级分别为 • OFF 关闭所有⽇志输出 • DRBUG 进⾏debug时候打印⽇志的等级 • INFO 打印⼀些⽤⼾提⽰信息 • WARN 打印警告信息 • ERROR 打印错误信息 • FATAL 打印致命信息- 导致程序崩溃的信息 #ifndef __M_LEVEL_H__ #define __M_LEVEL_H__ namespace bitlog{class LogLevel{public:enum class value {DEBUG,INFO,WARN,ERROR,FATAL,OFF};static const char *toString(LogLevel::value l) {switch(l) {#define TOSTRING(name) #namecase LogLevel::value::DEBUG: return TOSTRING(DEBUG);case LogLevel::value::INFO: return TOSTRING(INFO);case LogLevel::value::WARN: return TOSTRING(WARN);case LogLevel::value::ERROR: return TOSTRING(ERROR);case LogLevel::value::FATAL: return TOSTRING(FATAL);case LogLevel::value::OFF: return TOSTRING(OFF);#undef TOSTRINGdefault: return UNKNOW;}return UNKNOW;}}; } #endif8.3 日志消息类设计 日志消息类主要是封装⼀条完整的⽇志消息所需的内容其中包括⽇志等级、对应的logger name、打印日志源⽂件的位置信息包括⽂件名和⾏号、线程ID、时间戳信息、具体的⽇志信息等内容。 #ifndef __M_MSG_H__ #define __M_MSG_H__ #include util.hpp #include level.hpp #include thread namespace bitlog{struct LogMsg {using ptr std::shared_ptrLogMsg;size_t _line;//⾏号size_t _ctime;//时间std::thread::id _tid;//线程IDstd::string _name;//⽇志器名称std::string _file;//⽂件名std::string _payload;//⽇志消息LogLevel::value _level;//⽇志等级LogMsg() {}LogMsg( std::string name, std::string file, size_t line, std::string payload, LogLevel::value level):_name(name), _file(file), _payload(payload), _level(level),_line(line), _ctime(util:: date::now()),_tid(std::this_thread::get_id()) {}}; } #endif
http://www.zqtcl.cn/news/590961/

相关文章:

  • 在网站中写小说想要删除如何做婚纱摄影的网站怎么做
  • 重庆自适应网站建设wordpress添加icon文件
  • 目前小说网站排名适合网站设计的gif图片
  • 深圳建立网站wordpress 安装语言
  • 南京做中英文网站海南网站建设哪家专业
  • 做网站用jquerywordpress邮件有什么用
  • 上海网站建设免the 7 wordpress
  • 知名建站的公司微信企业app手机下载安装
  • 鹤山做网站羊毛网站建设视频
  • 图书类网站开发的背景建筑培训机构
  • 外贸网站建设制作wordpress管理员页面404
  • 北郊网站建设app网站开发哪里有
  • 像素人物制作网站网站开发的话术
  • 网站关键词怎么优化排名wordpress电子商城模板
  • 电子商务网站建设与维护能赚多少钱成交型网站建设
  • 到国外做网站网站是怎么回事中国一级建造师网官网
  • 惠州网站建设哪家好网站对图片优化
  • 酒店网站建设报价详情wordpress表单留言
  • 58同城做公司网站怎修改在线葡京在线葡京
  • 家纺网站模板wordpress折叠菜单
  • 建设信用中国网站站群系统破解版
  • 百度怎么投放广告凡科网站可以做seo优化
  • 医院网站建设 不足好的手机网站建设公司
  • 简历上作品展示网站链接怎么做wordpress的登陆地址修改密码
  • 深圳做响应式网站公司公司网站开发费用放在什么科目
  • 网站页面上的悬浮窗怎么做简单好看的版面设计图
  • 我要在58上面做网站硬件开发和嵌入式的区别
  • 西安网站推广慧创新手怎么开网店
  • 做羞羞事视频网站网站策划书基本项目
  • 对网站建设的维护优秀设计网站推荐