enhanced dir.c to handle both mbs and wcs by implementing the new QSE_DIR_WCSPATH option
This commit is contained in:
@ -60,8 +60,9 @@ typedef enum qse_dir_errnum_t qse_dir_errnum_t;
|
||||
enum qse_dir_flag_t
|
||||
{
|
||||
QSE_DIR_MBSPATH = (1 << 0),
|
||||
QSE_DIR_SORT = (1 << 1),
|
||||
QSE_DIR_SKIPSPCDIR = (1 << 2) /**< limited to normal entries excluding . and .. */
|
||||
QSE_DIR_WCSPATH = (1 << 1),
|
||||
QSE_DIR_SORT = (1 << 2),
|
||||
QSE_DIR_SKIPSPCDIR = (1 << 3) /**< limited to normal entries excluding . and .. */
|
||||
};
|
||||
typedef enum qse_dir_flag_t qse_dir_flag_t;
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
*/
|
||||
#include <qse/types.h>
|
||||
#include <qse/macros.h>
|
||||
#include <qse/cmn/str.h>
|
||||
|
||||
typedef qse_cmgr_t* (*qse_cmgr_finder_t) (const qse_char_t* name);
|
||||
|
||||
@ -470,6 +471,20 @@ QSE_EXPORT qse_mchar_t* qse_wcsnatombsdup (
|
||||
qse_mmgr_t* mmgr
|
||||
);
|
||||
|
||||
|
||||
#if defined(QSE_CHAR_IS_MCHAR)
|
||||
# define qse_strtombsdup(sa,mmgr) qse_strdup(sa,mmgr)
|
||||
# define qse_strtowcsdup(sa,mmgr) qse_mbstowcsdup(sa,QSE_NULL,mmgr)
|
||||
# define qse_strtombsdupwithcmgr(sa,mmgr,cmgr) qse_strdup(sa,mmgr)
|
||||
# define qse_strtowcsdupwithcmgr(sa,mmgr,cmgr) qse_mbstowcsdupwithcmgr(sa,QSE_NULL,mmgr,cmgr)
|
||||
|
||||
#else
|
||||
# define qse_strtombsdup(sa,mmgr) qse_wcstombsdup(sa,QSE_NULL,mmgr)
|
||||
# define qse_strtowcsdup(sa,mmgr) qse_wcsdup(sa,mmgr)
|
||||
# define qse_strtombsdupwithcmgr(sa,mmgr,cmgr) qse_wcstombsdupwithcmgr(sa,QSE_NULL,mmgr,cmgr)
|
||||
# define qse_strtowcsdupwithcmgr(sa,mmgr,cmgr) qse_wcsdup(sa,mmgr)
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
@ -1392,6 +1392,7 @@ QSE_EXPORT qse_wchar_t* qse_wcstradup (
|
||||
# define qse_cstradup(sa,len,mmgr) qse_wcstradup(sa,len,mmgr)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* The qse_mbsstr() function searchs a string \a str for the first occurrence
|
||||
* of a substring \a sub.
|
||||
|
Reference in New Issue
Block a user