AgsFileUtil

AgsFileUtil — file util

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Includes

#include <ags/lib/ags_file_util.h>

Description

Common utility functions related to text or XML files.

Functions

ags_file_util_alloc ()

AgsFileUtil *
ags_file_util_alloc (gchar *app_encoding,
                     gchar *encoding);

Allocate AgsFileUtil

Parameters

app_encoding

the application encoding

 

encoding

the file encoding

 

Returns

a new AgsFileUtil

Since: 6.3.0


ags_file_util_copy ()

gpointer
ags_file_util_copy (AgsFileUtil *ptr);

Create a copy of ptr .

Parameters

ptr

the original AgsFileUtil

 

Returns

a pointer of the new AgsFileUtil

Since: 6.3.0


ags_file_util_free ()

void
ags_file_util_free (AgsFileUtil *ptr);

Free the memory of ptr .

Parameters

ptr

the AgsFileUtil

 

Since: 6.3.0


ags_file_util_get_file_version ()

gchar *
ags_file_util_get_file_version (AgsFileUtil *file_util);

set file version of file_util .

Parameters

file_util

the AgsFileUtil

 

file_version

the file version

 

Since: 6.3.0


ags_file_util_set_file_version ()

void
ags_file_util_set_file_version (AgsFileUtil *file_util,
                                gchar *file_version);

ags_file_util_get_app_encoding ()

gchar *
ags_file_util_get_app_encoding (AgsFileUtil *file_util);

Get application encoding of file_util .

Parameters

file_util

the AgsFileUtil

 

Returns

the application encoding.

[transfer full]

Since: 6.3.0


ags_file_util_get_encoding ()

gchar *
ags_file_util_get_encoding (AgsFileUtil *file_util);

Get encoding of file_util .

Parameters

file_util

the AgsFileUtil

 

Returns

the encoding.

[transfer full]

Since: 6.3.0


ags_file_util_get_int ()

gint
ags_file_util_get_int (AgsFileUtil *file_util,
                       gchar *str);

Get integer from string.

Parameters

file_util

the AgsFileUtil

 

str

the string to convert

 

Returns

the converted integer

Since: 6.3.0


ags_file_util_put_int ()

gchar *
ags_file_util_put_int (AgsFileUtil *file_util,
                       gint value);

Put integer to string.

Parameters

file_util

the AgsFileUtil

 

value

the value

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_get_uint ()

guint
ags_file_util_get_uint (AgsFileUtil *file_util,
                        gchar *str);

Get unsigned integer from string.

Parameters

file_util

the AgsFileUtil

 

str

the string to convert

 

Returns

the converted unsigned integer

Since: 6.3.0


ags_file_util_put_uint ()

gchar *
ags_file_util_put_uint (AgsFileUtil *file_util,
                        guint value);

Put unsigned integer to string.

Parameters

file_util

the AgsFileUtil

 

value

the value

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_get_int64 ()

gint64
ags_file_util_get_int64 (AgsFileUtil *file_util,
                         gchar *str);

Get long long integer from string.

Parameters

file_util

the AgsFileUtil

 

str

the string to convert

 

Returns

the converted long long integer

Since: 6.3.0


ags_file_util_put_int64 ()

gchar *
ags_file_util_put_int64 (AgsFileUtil *file_util,
                         gint64 value);

Put long long integer to string.

Parameters

file_util

the AgsFileUtil

 

value

the value

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_get_uint64 ()

guint64
ags_file_util_get_uint64 (AgsFileUtil *file_util,
                          gchar *str);

Get unsigned long long integer.

Parameters

file_util

the AgsFileUtil

 

str

the string to convert

 

Returns

the converted unsigned long long integer

Since: 6.3.0


ags_file_util_put_uint64 ()

gchar *
ags_file_util_put_uint64 (AgsFileUtil *file_util,
                          guint64 value);

Put unsigned long long integer to string.

Parameters

file_util

the AgsFileUtil

 

value

the value

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_get_float ()

gfloat
ags_file_util_get_float (AgsFileUtil *file_util,
                         gchar *str);

Get arbitary size floating point number from string.

Parameters

file_util

the AgsFileUtil

 

str

the string

 

Returns

the arbitary size floating point number

Since: 6.3.0


ags_file_util_put_float ()

gchar *
ags_file_util_put_float (AgsFileUtil *file_util,
                         gfloat value);

Put arbitary size floating point number to string.

Parameters

file_util

the AgsFileUtil

 

value

the value

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_get_double ()

gdouble
ags_file_util_get_double (AgsFileUtil *file_util,
                          gchar *str);

Get double precision size floating point number from string.

Parameters

file_util

the AgsFileUtil

 

str

the string

 

Returns

the double precision size floating point number

Since: 6.3.0


ags_file_util_put_double ()

gchar *
ags_file_util_put_double (AgsFileUtil *file_util,
                          gdouble value);

Put double precision size floating point number to string.

Parameters

file_util

the AgsFileUtil

 

value

the value

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_get_complex ()

AgsComplex *
ags_file_util_get_complex (AgsFileUtil *file_util,
                           gchar *str);

Get complex floating point number from string.

Parameters

file_util

the AgsFileUtil

 

str

the string

 

Returns

the complex floating point number

Since: 6.3.0


ags_file_util_put_complex ()

gchar *
ags_file_util_put_complex (AgsFileUtil *file_util,
                           AgsComplex *value);

Put complex floating point number to string.

Parameters

file_util

the AgsFileUtil

 

value

the value

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_get_string ()

gchar *
ags_file_util_get_string (AgsFileUtil *file_util,
                          gchar *str,
                          gint max_length);

Get string from str .

Parameters

file_util

the AgsFileUtil

 

str

the string

 

max_length

the maximum length of string

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0


ags_file_util_put_string ()

gchar *
ags_file_util_put_string (AgsFileUtil *file_util,
                          gchar *str,
                          gint length);

Put str to string.

Parameters

file_util

the AgsFileUtil

 

str

the string

 

length

the length of string

 

Returns

the newly allocated string.

[transfer full]

Since: 6.3.0

Types and Values

AGS_FILE_UTIL_64BIT_MAX_STRING_LENGTH

#define AGS_FILE_UTIL_64BIT_MAX_STRING_LENGTH (20)

AGS_FILE_UTIL_DOUBLE_MAX_STRING_LENGTH

#define AGS_FILE_UTIL_DOUBLE_MAX_STRING_LENGTH (16)