Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Functions
NumberFormatter.h File Reference

Number formatting and parsing. More...

#include <Objectively/Number.h>
#include <Objectively/String.h>

Go to the source code of this file.

Data Structures

struct  NumberFormatter
 Number formatting and parsing. More...
 

Macros

#define NUMBERFORMAT_CURRENCY   "%'.2lf"
 Currency format. More...
 
#define NUMBERFORMAT_DECIMAL   "%lf"
 Decimal format. More...
 
#define NUMBERFORMAT_INTEGER   "%ld"
 Integer format. More...
 

Functions

OBJECTIVELY_EXPORT Class_NumberFormatter (void)
 

Detailed Description

Number formatting and parsing.

Definition in file NumberFormatter.h.

Macro Definition Documentation

◆ NUMBERFORMAT_CURRENCY

#define NUMBERFORMAT_CURRENCY   "%'.2lf"

Currency format.

Definition at line 37 of file NumberFormatter.h.

◆ NUMBERFORMAT_DECIMAL

#define NUMBERFORMAT_DECIMAL   "%lf"

Decimal format.

Definition at line 42 of file NumberFormatter.h.

◆ NUMBERFORMAT_INTEGER

#define NUMBERFORMAT_INTEGER   "%ld"

Integer format.

Definition at line 47 of file NumberFormatter.h.

Function Documentation

◆ _NumberFormatter()

OBJECTIVELY_EXPORT Class * _NumberFormatter ( void  )

Definition at line 91 of file NumberFormatter.c.

91 {
92 static Class *clazz;
93 static Once once;
94
95 do_once(&once, {
96 clazz = _initialize(&(const ClassDef) {
97 .name = "NumberFormatter",
98 .superclass = _Object(),
99 .instanceSize = sizeof(NumberFormatter),
100 .interfaceOffset = offsetof(NumberFormatter, interface),
101 .interfaceSize = sizeof(NumberFormatterInterface),
103 });
104 });
105
106 return clazz;
107}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition: Class.c:91
static void initialize(Class *clazz)
long Once
The Once type.
Definition: Once.h:37
#define do_once(once, block)
Executes the given block at most one time.
Definition: Once.h:43
ClassDefs are passed to _initialize via an archetype to initialize a Class.
Definition: Class.h:41
The runtime representation of a Class.
Definition: Class.h:95
Number formatting and parsing.
Class * _Object(void)
The Object archetype.
Definition: Object.c:136