![]() ![]() Static SuperString SuperString:: Const( const SuperString:: Byte *bytes, SuperString:: Encoding encoding) In the other hand, we used ::Const in main because the sequence will live as long as the executable lives, that's important because SuperString will not copy the sequence to avoid memory redundancy. In myFunc, we used SuperString::Copy because the sequence that we're building our string from, has a limited lifetime and well be deleted once the function returns, that why we use ::Copy to tell SuperString that we should copy the data and keep them for further use. ![]() equivalent to SuperString::Const("SuperString is cool!") SuperString s2 = SuperString::Const(seq) SuperString string = SuperString::Copy(chars) To allow this, there're are two way to create a SuperString using static method SuperString::Const or SuperString::Copy. API Construct a new stringĪs mentioned above, SuperString is automatically garbage collected, so you don't have to think about how and when to free a SuperString instance. The header file that contains SuperString declarations is SuperString/include/SuperString.hh, the source file that contains the definitions is SuperString/src/, use them as you prefer. Target_link_libraries(myexecutable SuperString) Without CMake # link your executable against SuperString Include_directories(ext/SuperString/include) # add SuperString headers to include directory Now, you will need to add those lines to your CMakeLists.txt # include SuperString In your project, clones SuperString to a directory where third-party libraries live (let's call it ext). You have any feature idea, a bug to correct or an improvement, feel free to open a issue or send your pull request. Support ASCII, UTF-8, UTF-16BE and UTF-32.SuperString uses Rope (data structure) and optimization techniques. SuperString is an efficient string library for C++, that achieves a remarkable memory and CPU optimization. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |