C++ 树层级存储

用了一个map来记录所有的层级关系,然后从root找起,依次找出所有的节点… // 用的是tinyXML读取 BOOL CXmlRead::ReadGroupInfo( std::map<CString, std::vector<std::pair<CString, BOOL>>> &mapGroup ) { // 载入文件 TiXmlDocument *doc = new TiXmlDocument(PATH); if

C++ base64编解码

static std::string base64_chars = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot; &quot;abcdefghijklmnopqrstuvwxyz&quot; &quot;0123456789+/&quot;; static bool is_base64(unsigned char c) { return (isalnum(c) || (c == '+') || (c == '/')); } std::string base64_encode(const unsigned char* bytes_to_encode,unsigned int in_len); int base64_decode(std::string const&amp; encoded_string,unsigned char* pObject); std::string base64_encode(const unsigned char* bytes_to_encode,unsigned int in_len) { std::string ret; int i = 0; int j = 0; unsigned char char_array_3[3]; unsigned char char_array_4[4]; while (in_len--) { char_array_3[i++] = *(bytes_to_encode++); if (i ==