GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
valuefmt.c File Reference

DBMI Library (base) - value formatting. More...

#include <stdio.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
Include dependency graph for valuefmt.c:

Go to the source code of this file.

Functions

int db_convert_Cstring_to_value (const char *Cstring, int sqltype, dbValue *value)
 Convert string to value. More...
 
int db_convert_value_to_string (dbValue *value, int sqltype, dbString *string)
 Convert value to string. More...
 

Detailed Description

DBMI Library (base) - value formatting.

(C) 1999-2009, 2011 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Joel Jones (CERL/UIUC), Radim Blazek
Doxygenized by Martin Landa <landa.martin gmail.com> (2011)

Definition in file valuefmt.c.

Function Documentation

◆ db_convert_Cstring_to_value()

int db_convert_Cstring_to_value ( const char *  Cstring,
int  sqltype,
dbValue value 
)

Convert string to value.

Parameters
Cstringstring buffer
sqltypeSQL data type
[out]valuepointer to dbValue
Returns
DB_OK on success
DB_FAILED on error

Definition at line 31 of file valuefmt.c.

Referenced by db_convert_Cstring_to_column_default_value(), and db_convert_Cstring_to_column_value().

◆ db_convert_value_to_string()

int db_convert_value_to_string ( dbValue value,
int  sqltype,
dbString string 
)

Convert value to string.

Parameters
valuepointer to dbValue
sqltypeSQL data type
[out]stringpointer to dbString
Returns
DB_OK on success

Definition at line 67 of file valuefmt.c.

References _, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_convert_value_datetime_into_string(), db_error(), DB_FAILED, db_get_value_double(), db_get_value_int(), db_get_value_string(), db_set_string(), db_sqltype_to_Ctype(), db_test_value_isnull(), and G_trim_decimal().

Referenced by db_convert_column_default_value_to_string(), and db_convert_column_value_to_string().