1 Star 0 Fork 0

2144/cppTemp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pch.h 2.92 KB
一键复制 编辑 原始数据 按行查看 历史
2144 提交于 2024-05-14 16:43 . ss
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <istream>
#include <ostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <memory>
#include <filesystem>
#include <queue>
#include <deque>
namespace fs = std::filesystem;
#define COLOR_NONE "\033[m"
#define COLOR_RED "\033[0;32;31m"
#define COLOR_LIGHT_RED "\033[1;31m"
#define COLOR_GREEN "\033[0;32;32m"
#define COLOR_LIGHT_GREEN "\033[1;32m"
#define COLOR_BLUE "\033[0;32;34m"
#define COLOR_LIGHT_BLUE "\033[1;34m"
#define COLOR_DARY_GRAY "\033[1;30m"
#define COLOR_CYAN "\033[0;36m"
#define COLOR_LIGHT_CYAN "\033[1;36m"
#define COLOR_PURPLE "\033[0;35m"
#define COLOR_LIGHT_PURPLE "\033[1;35m"
#define COLOR_BROWN "\033[0;33m"
#define COLOR_YELLOW "\033[1;33m"
#define COLOR_LIGHT_GRAY "\033[0;37m"
#define COLOR_WHITE "\033[1;37m"
#ifdef _WIN32
#include <Windows.h>
#define LOGI(fmt, ...) printf(COLOR_NONE "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "info", ##__VA_ARGS__)
#define LOGE(fmt, ...) printf(COLOR_RED "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "error", ##__VA_ARGS__)
#define LOGD(fmt, ...) printf(COLOR_GREEN "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "debug", ##__VA_ARGS__)
#define LOGW(fmt, ...) printf(COLOR_YELLOW "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "warning", ##__VA_ARGS__)
#endif
#ifdef __linux__
#include <unistd.h>
#include <cstdlib>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ipc.h>
#include <sys/acct.h>
#include <sys/auxv.h>
#ifdef __ANDROID__
#include <android/log.h>
#include <android_native_app_glue.h>
#include <android/asset_manager.h>
#define LOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "info", fmt, ##__VA_ARGS__)
#define LOGE(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "error", fmt, ##__VA_ARGS__)
#define LOGD(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "debug", fmt, ##__VA_ARGS__)
#define LOGW(fmt, ...) __android_log_print(ANDROID_LOG_INFO, "warning", fmt, ##__VA_ARGS__)
#else
#define LOGI(fmt, ...) printf(COLOR_NONE "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "info", ##__VA_ARGS__)
#define LOGE(fmt, ...) printf(COLOR_RED "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "error", ##__VA_ARGS__)
#define LOGD(fmt, ...) printf(COLOR_GREEN "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "debug", ##__VA_ARGS__)
#define LOGW(fmt, ...) printf(COLOR_YELLOW "[%s %s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "warning", ##__VA_ARGS__)
#endif
#endif
#pragma warning(disable : 4305)
#pragma warning(disable : 4005)
#pragma warning(disable : 4244)
#define OUT_LOG(x, y) \
{ \
std::ofstream ofs(y, std::ios::out); \
ofs << x; \
ofs.flush(); \
ofs.close(); \
} \
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/iamherer/cpp-temp4.git
git@gitee.com:iamherer/cpp-temp4.git
iamherer
cpp-temp4
cppTemp
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385