Friday, July 8, 2022
HomeWordPress DevelopmentC++ I wrote a easy and quick formatting library for strings

C++ I wrote a easy and quick formatting library for strings


A fast C++ formatting library

I used to be engaged on a logging library, and wanted some option to format strings shortly, easy and clear, so I wrote this library.

This library is just not the perfect basically, however for my undertaking wants it’s the quickest and the perfect



Options

  • Simple embrace and simply name fstring()
  • Quick Only a easy code to extract and modify the string
  • Gentle No numerous code, only one class with just one perform to name
  • CrossPlatform It would not use any third celebration libraries, so it ought to work anyplace



Syntax

// parameters
fstring("{}, {}", "Whats up","World"); // "Whats up, World"

// padding
fstring("%5Hellopercent5Worldpercent5"); // "     Whats up     World     "

// sensible padding, divide string to sections, last padding = padding - size of part
fstring("%.10Hello.%%.10World.%"); // "Whats up     World     "

// consequence
fstring(..).get(); // return to &string
Enter fullscreen mode

Exit fullscreen mode



Goal

  • Offering a straightforward, quick and clear option to format strings

  • Offering the perfect efficiency for hundreds of thousands of instances use



Check Information

  • OS: Ubuntu 22.04 LTS / 64-bit
  • Processor: Intel® Coreâ„¢ i7-6500U CPU @ 2.50GHz × 4
  • Compiler: g++ 12
  • Flags: -O3
  • C++ Model: 23



Questions

  • Is there something that could possibly be improved?
  • Are there errors?
  • Do you might have any ideas or feedback?



Updates / Edits

i’ll add edits or updates right here


#c #cpp

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments