comp.lang.ada
 help / color / mirror / Atom feed
* Simple string template formatter (Dmitry A. Kazakov take note)
@ 2017-11-22 20:23 Victor Porton
  2017-11-22 20:44 ` Victor Porton
  2017-11-22 22:26 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 3+ messages in thread
From: Victor Porton @ 2017-11-22 20:23 UTC (permalink / raw)


I created a simple string template formatter (no if-then-else, no include, 
just substitution of variables).

Example:

"First phrase: {1}. Second phrase: {2}."

This formatter is suitable for short strings, such as phrases for gettext.

https://github.com/vporton/xml-boiler/blob/master/src/boiler-auxiliary-string_formatter.ads
https://github.com/vporton/xml-boiler/blob/master/src/boiler-auxiliary-string_formatter.adb

My code was not tested!

Dmitry, I ask you to add something like this to your Simple Components.

My program anyway uses Simple Components, so after you implement it, I can 
remove these files from my sources.

I released the files in question both GPLv3 and Apache License 2.0. So feel 
free to use it as a coding example.

-- 
Victor Porton - http://portonvictor.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-22 22:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 20:23 Simple string template formatter (Dmitry A. Kazakov take note) Victor Porton
2017-11-22 20:44 ` Victor Porton
2017-11-22 22:26 ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox