mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
add routine to convert account type string to enum
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3478 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6cf34972a0
commit
6dc0871f26
@ -1453,6 +1453,17 @@ xaccAccountStringToType(const char* str, int *type) {
|
||||
|
||||
#undef GNC_RETURN_ON_MATCH
|
||||
|
||||
/* impedance mismatch is a source of loss */
|
||||
GNCAccountType
|
||||
xaccAccountStringToEnum(const char* str)
|
||||
{
|
||||
int type;
|
||||
gboolean rc;
|
||||
rc = xaccAccountStringToType(str, &type);
|
||||
if (FALSE == rc) return BAD_TYPE;
|
||||
return ((GNCAccountType) type);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
|
@ -112,6 +112,7 @@ char * xaccAccountGetTypeStr (int type); /* GUI names */
|
||||
"INCOME". */
|
||||
char * xaccAccountTypeEnumAsString (int type);
|
||||
gboolean xaccAccountStringToType (const char* str, int *type);
|
||||
GNCAccountType xaccAccountStringToEnum (const char* str);
|
||||
|
||||
gboolean xaccAccountTypesCompatible (int parent_type, int child_type);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user