DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
misc.h
1 /*********************************************************************************************************************************************/
2 /* DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. */
3 /* Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, */
4 /* document analysis. Offline processing possible for security and confidentiality */
5 /* */
6 /* Copyright (c) SILVERCODERS Ltd, http://silvercoders.com */
7 /* Project homepage: https://github.com/docwire/docwire */
8 /* */
9 /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_MISC_H
13 #define DOCWIRE_MISC_H
14 
15 #include "core_export.h"
16 #include "data_source.h"
17 #include <string>
18 #include <vector>
19 #include "wv2/src/ustring.h"
20 #include <time.h>
21 
22 struct tm;
23 
24 namespace docwire
25 {
26 
27 using namespace wvWare;
28 
29 typedef std::vector<std::string> svector;
30 
31 DOCWIRE_CORE_EXPORT std::string formatTable(std::vector<svector>& mcols);
32 DOCWIRE_CORE_EXPORT std::string formatUrl(const std::string& mlink_url, const std::string& mlink_text);
33 DOCWIRE_CORE_EXPORT std::string formatList(std::vector<std::string>& mlist);
34 DOCWIRE_CORE_EXPORT std::string formatNumberedList(std::vector<std::string>& mlist);
35 
36 DOCWIRE_CORE_EXPORT std::string ustring_to_string(const UString& s);
37 
38 DOCWIRE_CORE_EXPORT UString utf8_to_ustring(const std::string& src);
39 
40 DOCWIRE_CORE_EXPORT std::string unichar_to_utf8(unsigned int unichar);
41 
59 inline bool utf16_unichar_has_4_bytes(unsigned int ch)
60 {
61  return (ch & 0xFC00) == 0xD800;
62 }
63 
64 DOCWIRE_CORE_EXPORT bool is_encrypted_with_ms_offcrypto(const data_source& data);
65 
66 DOCWIRE_CORE_EXPORT tm *thread_safe_gmtime (const time_t *timer, struct tm &time_buffer);
67 
68 } // namespace docwire
69 
70 #endif
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19
bool utf16_unichar_has_4_bytes(unsigned int ch)
Definition: misc.h:59