| 1 | /* |
| 2 | * Copyright (C) 2004-2005 by Objective Systems, Inc. |
| 3 | * |
| 4 | * This software is furnished under an open source license and may be |
| 5 | * used and copied only in accordance with the terms of this license. |
| 6 | * The text of the license may generally be found in the root |
| 7 | * directory of this installation in the COPYING file. It |
| 8 | * can also be viewed online at the following URL: |
| 9 | * |
| 10 | * http://www.obj-sys.com/open/license.html |
| 11 | * |
| 12 | * Any redistributions of this file including modified versions must |
| 13 | * maintain this copyright notice. |
| 14 | * |
| 15 | *****************************************************************************/ |
| 16 | /** |
| 17 | * @file ooUtils.h |
| 18 | * This file contains general utility functions. |
| 19 | */ |
| 20 | #ifndef _OOUTILS_H_ |
| 21 | #define _OOUTILS_H_ |
| 22 | #include "ootypes.h" |
| 23 | |
| 24 | /** |
| 25 | * Get text from a text table for a given enumeration index. |
| 26 | * |
| 27 | * @param idx Index of item in table |
| 28 | * @param table The table containing the text items |
| 29 | * @param tabsiz Number of items in the table |
| 30 | * @return Text for item or '?' if idx outside bounds of table |
| 31 | */ |
| 32 | EXTERN const char* ooUtilsGetText |
| 33 | (OOUINT32 idx, const char** table, size_t tabsiz); |
| 34 | |
| 35 | /** |
| 36 | * Test if given string value is empty. String is considered to empty |
| 37 | * if value is NULL or there are no characters in string (strlen == 0). |
| 38 | * |
| 39 | * @param str String to test |
| 40 | * @return TRUE if string empty; FALSE otherwise |
| 41 | */ |
| 42 | EXTERN OOBOOL ooUtilsIsStrEmpty (const char * str); |
| 43 | |
| 44 | |
| 45 | /** |
| 46 | * Test if given string value is digit string. |
| 47 | * |
| 48 | * @param str String to test |
| 49 | * @return TRUE if string contains all digits; FALSE otherwise |
| 50 | */ |
| 51 | EXTERN OOBOOL ooIsDialedDigit(const char* str); |
| 52 | |
| 53 | #endif |