cmake可见性和AppArmor示例

This commit is contained in:
NoDistanceY 2026-09-03 10:39:21 +08:00
commit 4b4b933e3d
19 changed files with 661 additions and 0 deletions

View file

@ -0,0 +1,9 @@
#include "timeutil.h"
#include <ctime>
std::string timestamp(const char* fmt) {
char buf[32];
std::time_t t = std::time(nullptr);
std::strftime(buf, sizeof(buf), fmt, std::localtime(&t));
return buf;
}

View file

@ -0,0 +1,3 @@
#pragma once
#include <string>
std::string timestamp(const char* fmt); // fmt 形如 "%H:%M:%S"