5 changed files with 133 additions and 39 deletions
-
105app_protocols/appexception/appexception.hpp
-
1appsrc/appsetting/project_port/project_port.cpp
-
1appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp
-
7appsrc/service/app_core.cpp
-
58test/test.cpp
@ -1,24 +1,46 @@ |
|||
#pragma once
|
|||
#include <signal.h>
|
|||
|
|||
#include <chrono>
|
|||
#include <fstream>
|
|||
#include <functional>
|
|||
#include <iostream>
|
|||
#include <list>
|
|||
#include <map>
|
|||
#include <memory>
|
|||
#include <set>
|
|||
#include <sstream>
|
|||
#include <string>
|
|||
#include <vector>
|
|||
using namespace std; |
|||
using namespace chrono; |
|||
|
|||
int main(int argc, char *argv[]) { |
|||
std::time_t now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); |
|||
std::string s(30, '\0'); |
|||
std::strftime(&s[0], s.size(), "%Y-%m-%d %H:%M:%S", std::localtime(&now)); |
|||
cout << s << endl; |
|||
std::string demangle(const std::string& mangled) { |
|||
std::string result; |
|||
std::vector<std::string> parts; |
|||
|
|||
size_t i = 0; |
|||
while (i < mangled.size()) { |
|||
if (std::isdigit(mangled[i])) { |
|||
// Read length of the following name
|
|||
size_t length = 0; |
|||
while (std::isdigit(mangled[i])) { |
|||
length = length * 10 + (mangled[i] - '0'); |
|||
i++; |
|||
} |
|||
// Get the name part
|
|||
std::string name = mangled.substr(i, length); |
|||
parts.push_back(name); |
|||
i += length; |
|||
} else { |
|||
// Handle other characters (if needed)
|
|||
// result += mangled[i];
|
|||
i++; |
|||
} |
|||
} |
|||
|
|||
// Join parts with '.'
|
|||
for (const auto& part : parts) { |
|||
if (!result.empty()) { |
|||
result += "."; |
|||
} |
|||
result += part; |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
int main() { |
|||
std::string mangledName = "_ZNKiflytop13zscanprotocol16ZSCanProtocolCom7callcmdEiiPhii"; |
|||
std::string demangledName = demangle(mangledName); |
|||
|
|||
std::cout << "Demangled Name: " << demangledName << std::endl; |
|||
return 0; |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue