spBase
読み取り中…
検索中…
一致する文字列を見つけられません
spString.h
[詳解]
1
4#ifndef __SPSTRING_H
5#define __SPSTRING_H
6
7#include <sp/spDefs.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
16 /*----@addtogroup spStringGroup----*/
17
19typedef struct _spConverter *spConverter;
20
21#define SP_TIME_FORMAT_MSEC_MASK (1<<0)
22#define SP_TIME_FORMAT_SEC_MASK (1<<1)
23#define SP_TIME_FORMAT_POINT_MASK (1<<2)
24#define SP_TIME_FORMAT_FLOORED_MASK (1<<9)
25#define SP_TIME_FORMAT_SEPARATED_MASK (1<<10)
26#define SP_TIME_FORMAT_USER1_MASK (1<<12)
27#define SP_TIME_FORMAT_USER2_MASK (1<<13)
28#define SP_TIME_FORMAT_USER3_MASK (1<<14)
29#define SP_TIME_FORMAT_USER4_MASK (1<<15)
30
31typedef enum {
32 SP_TIME_FORMAT_UNKNOWN = 0,
33 SP_TIME_FORMAT_MSEC = SP_TIME_FORMAT_MSEC_MASK,
34 SP_TIME_FORMAT_FLOORED_MSEC = (SP_TIME_FORMAT_FLOORED_MASK|SP_TIME_FORMAT_MSEC_MASK),
35
36 SP_TIME_FORMAT_SEC = SP_TIME_FORMAT_SEC_MASK,
37 SP_TIME_FORMAT_FLOORED_SEC = (SP_TIME_FORMAT_FLOORED_MASK|SP_TIME_FORMAT_SEC_MASK),
38 /* hh:mm:ss.ssssss */
39 SP_TIME_FORMAT_SEPARATED_SEC = (SP_TIME_FORMAT_SEPARATED_MASK|SP_TIME_FORMAT_SEC_MASK),
40 /* hh:mm:ss */
41 SP_TIME_FORMAT_FLOORED_SEPARATED_SEC = (SP_TIME_FORMAT_FLOORED_MASK|SP_TIME_FORMAT_SEPARATED_MASK|SP_TIME_FORMAT_SEC_MASK),
42
43 SP_TIME_FORMAT_POINT = SP_TIME_FORMAT_POINT_MASK,
44
45 SP_TIME_FORMAT_USER1 = SP_TIME_FORMAT_USER1_MASK,
46 SP_TIME_FORMAT_USER2 = SP_TIME_FORMAT_USER2_MASK,
47 SP_TIME_FORMAT_USER3 = SP_TIME_FORMAT_USER3_MASK,
48 SP_TIME_FORMAT_USER4 = SP_TIME_FORMAT_USER4_MASK,
49} spTimeFormat;
50
51
52#if defined(MACOS)
53#pragma import on
54#endif
55
57extern spBool spEqLanguage(const char *lang1, const char *lang2);
59extern spBool spGetLanguageId(const char *lang, char *id, int id_size);
61extern spBool spIsUTFLang(const char *lang);
63extern spBool spIsJapaneseLang(const char *lang);
64extern spBool spIsUTF8First(int c, int *continuation); /* continuation: continuation byte length */
65extern spBool spIsMBTailCandidate(int prev_c, int c);
67extern char *spStrChr(const char *str, int c);
69extern char *spStrRChr(const char *str, int c);
70
71extern int spUnicode16ToUTF8(const unsigned short *unicode, unsigned char *buf, int buf_size);
72extern int spUTF8ToUnicode16(const unsigned char *utf8, unsigned short *buf, int buf_size);
73extern int spUnicode16Length(const unsigned short *unicode);
74extern unsigned short *spUnicode16Copy(unsigned short *dest, int destlen, const unsigned short *src);
75extern unsigned short *xspUnicode16Clone(const unsigned short *unicode);
77extern const char *spGetSupportedEncoding(const char *code);
79extern spConverter spOpenConverter(const char *icode, const char *ocode);
81extern char *xspConvert(spConverter conv, const char *input);
83extern void spCloseConverter(spConverter conv);
84
85extern spBool spGetTimeNString(double sec, spTimeFormat time_format, char *buf, int bufsize);
86extern spBool spGetTimeString(double sec, spTimeFormat time_format, char *buf);
87extern spTimeFormat spConvertTimeString(char *buf, spTimeFormat time_format, double *sec);
88extern spBool spGetTimeFormatString(spTimeFormat time_format, char *format);
89extern spBool spGetTimeFormatNString(spTimeFormat time_format, char *format, int formatsize);
90extern spBool spConvertTimeFormatString(const char *format, spTimeFormat *time_format);
91
92#if defined(MACOS)
93#pragma import off
94#endif
95
96 /*----@addtogroup spStringGroup----*/
97
98#ifdef __cplusplus
99} /* Close scope of 'extern "C"' declaration */
100#endif
101
102#endif /* __SPSTRING_H */
int spBool
Definition spDefs.h:248
spBool spIsUTFLang(const char *lang)
spBool spEqLanguage(const char *lang1, const char *lang2)
char * xspConvert(spConverter conv, const char *input)
spBool spIsJapaneseLang(const char *lang)
char * spStrChr(const char *str, int c)
const char * spGetSupportedEncoding(const char *code)
spConverter spOpenConverter(const char *icode, const char *ocode)
spBool spGetLanguageId(const char *lang, char *id, int id_size)
struct _spConverter * spConverter
Definition spString.h:19
void spCloseConverter(spConverter conv)
char * spStrRChr(const char *str, int c)