cycfi / infra Goto Github PK
View Code? Open in Web Editor NEWCommon facilities
Common facilities
inline std::string codepoint_to_utf8(char32_t codepoint)
{
std::string result{ 8 };
detail::codepoint_to_utf8(codepoint, &result[0]);
return result;
}
In win10 vs2022 is 4 bytes, Therefore, when inputting Chinese characters, it will lead to subsequent processing errors.
Here are my modifications:
inline std::string codepoint_to_utf8(char32_t codepoint)
{
char cache[8];
auto result = detail::codepoint_to_utf8(codepoint, cache);
return result;
}
Based off this comment for PR: cycfi/artist#2 (comment)
Add functions to include/support.hpp
:
to_little_endian
to_big_endian
for various scalar types (e.g. uint16_t, uint32_t, etc...).
infra/include/infra/filesystem.hpp
Lines 23 to 29 in 991d014
I expected it is going to happen at some point... My project uses fs
namespace consistently for its code. Can you change this? IMO such short namespace definition is rather risky at global scope. Maybe use cycfi::fs
or infra::fs
?
Building on a newly cloned elements (and infra) it appears that BOOST is still required:
See: \elements\lib\include\elements/view.hpp
Line: 17
My understanding was that BOOST should no longer be required.
System Overview:
Windows 10 Build w/Visual Studio 19
There is a problem with GCC and Clang in certain range of versions because while they have std::filesystem
implementation they require explicit linking to it because at that point the library was not merged into the core standard library implementation.
https://stackoverflow.com/questions/53807011/undefined-reference-error-with-new-filesystem-library-and-clang7
https://stackoverflow.com/questions/58545562/what-is-the-correct-way-to-link-c17-filesystem-with-cmake
There is no consensus in CMake too: https://gitlab.kitware.com/cmake/cmake/issues/17834
I have this problem on one machine and I think the cleanest thing we can do is to give explicit CMake options to add -lc++fs
or -lstdc++fs
flags to infra target.
infra/include/infra/support.hpp
Lines 344 to 350 in 4636dd5
Character literals also include terminating null byte, so for u8""
this function would use N = 1
which is wrong. It should use N -1
. There is no way to have a literal character array of length 0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.