- FastFormat
infobox software
name = FastFormat C/C++ Formatting Library
caption =
latest_release_version = 0.2.1 (alpha 3)
latest_release_date =12 September 2008
programming_language =C++
operating_system =Cross-platform
genre =Formatting
license = BSD-form license
website = [http://fastformat.org/ http://fastformat.org/]FastFormat is an
open source C++ formatting library, provided bySynesis Software , whose design focus is performance, robustness and transparency. It claims 100% type-safety, and extremely high efficiency.FastFormat is completely free for use in both commercial and non-commercial activities, being licensed under the
BSD license . It is platform-independent, working onUNIX (Linux ,Solaris ,FreeBSD ),Mac OS X , andWindows (x86 andx64 ). It is compiler-independent, and is known to work withBorland , MetrowerksCodeWarrior ,Comeau ,Digital Mars ,GCC ,Intel and MicrosoftVisual C++ compilers.FastFormat provides both Format and Write
API s. It is infinitely extensible to allowing formatting of arbitrary argument types, with format strings of arbitrary types, to receivers, known as sinks, of arbitrary types.Design Principles
The principles underpinning FastFormat arecite book
last = Wilson
first = Matthew
authorlink = Matthew Wilson
year = 2007
title = Extended STL
publisher = Addison-Wesley
id = ISBN 0-321-30550-7] :
* the sinks, formats and arguments may be of arbitrary types
* any argument that must be converted into string form will be converted only once, regardless of how many times it is used in the resultant string
* the measurement (e.g.strlen()
) and copying (e.g.memcpy()
) of each argument is done only onceAPIs
FastFormat has two APIs:
* The Format API comprises thefmt()
andfmtln()
function template suites
* The Write API comprises thewrite()
andwriteln()
function template suitesHello, World
Applying FastFormat to the classic Hello, World program gives the following examples:
;1. Using the Write API, with the ostream sink
;2. Using the Write API, with the string sink
;3. Using the Format API, with the ostream sink
;4. Using the Format API, with the string sink
Dependencies
The library depends on the STLSoft C++ libraries.
References
External links
* [http://fastformat.org/ FastFormat Official Website]
* [http://stlsoft.org/ STLSoft Official Website]
* [http://stlsoft-musings.blogspot.com/ STLSoft Musings] Blog
* [news://news.digitalmars.com/c++.stlsoft STLSoft newsgroup]
Wikimedia Foundation. 2010.