|
ReactOS 0.4.17-dev-573-g8315b8c
|
#include <string.h>#include <stdlib.h>#include <stdarg.h>#include <stdio.h>#include "windef.h"#include "winbase.h"#include "winerror.h"#include "variant.h"#include "wine/debug.h"
Go to the source code of this file.
Classes | |
| struct | tagFMT_SHORT_HEADER |
| struct | tagFMT_HEADER |
| struct | tagFMT_STRING_HEADER |
| struct | tagFMT_NUMBER_HEADER |
| struct | tagFMT_DATE_HEADER |
| struct | tagNAMED_FORMAT |
Macros | |
| #define | LCID_US MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT) |
| #define | FMT_TYPE_UNKNOWN 0x0 |
| #define | FMT_TYPE_GENERAL 0x1 |
| #define | FMT_TYPE_NUMBER 0x2 |
| #define | FMT_TYPE_DATE 0x3 |
| #define | FMT_TYPE_STRING 0x4 |
| #define | FMT_TO_STRING 0x0 /* If header->size == this, act like VB's Str() fn */ |
| #define | FmtGetPositive(x) (x->starts[0]) |
| #define | FmtGetNegative(x) (x->starts[1] ? x->starts[1] : x->starts[0]) |
| #define | FmtGetZero(x) (x->starts[2] ? x->starts[2] : x->starts[0]) |
| #define | FmtGetNull(x) (x->starts[3] ? x->starts[3] : x->starts[0]) |
| #define | FMT_FLAG_LT 0x1 /* Has '<' (lower case) */ |
| #define | FMT_FLAG_GT 0x2 /* Has '>' (upper case) */ |
| #define | FMT_FLAG_RTL 0x4 /* Has '!' (Copy right to left) */ |
| #define | FMT_FLAG_PERCENT 0x1 /* Has '%' (Percentage) */ |
| #define | FMT_FLAG_EXPONENT 0x2 /* Has 'e' (Exponent/Scientific notation) */ |
| #define | FMT_FLAG_THOUSANDS 0x4 /* Has ',' (Standard use of the thousands separator) */ |
| #define | FMT_FLAG_BOOL 0x20 /* Boolean format */ |
| #define | FMT_GEN_COPY 0x00 /* \n, "lit" => 0,pos,len: Copy len chars from input+pos */ |
| #define | FMT_GEN_INLINE 0x01 /* => 1,len,[chars]: Copy len chars from token stream */ |
| #define | FMT_GEN_END 0x02 /* \0,; => 2: End of the tokenised format */ |
| #define | FMT_DATE_TIME_SEP 0x03 /* Time separator char */ |
| #define | FMT_DATE_DATE_SEP 0x04 /* Date separator char */ |
| #define | FMT_DATE_GENERAL 0x05 /* General format date */ |
| #define | FMT_DATE_QUARTER 0x06 /* Quarter of the year from 1-4 */ |
| #define | FMT_DATE_TIME_SYS 0x07 /* System long time format */ |
| #define | FMT_DATE_DAY 0x08 /* Day with no leading 0 */ |
| #define | FMT_DATE_DAY_0 0x09 /* Day with leading 0 */ |
| #define | FMT_DATE_DAY_SHORT 0x0A /* Short day name */ |
| #define | FMT_DATE_DAY_LONG 0x0B /* Long day name */ |
| #define | FMT_DATE_SHORT 0x0C /* Short date format */ |
| #define | FMT_DATE_LONG 0x0D /* Long date format */ |
| #define | FMT_DATE_MEDIUM 0x0E /* Medium date format */ |
| #define | FMT_DATE_DAY_WEEK 0x0F /* First day of the week */ |
| #define | FMT_DATE_WEEK_YEAR 0x10 /* First week of the year */ |
| #define | FMT_DATE_MON 0x11 /* Month with no leading 0 */ |
| #define | FMT_DATE_MON_0 0x12 /* Month with leading 0 */ |
| #define | FMT_DATE_MON_SHORT 0x13 /* Short month name */ |
| #define | FMT_DATE_MON_LONG 0x14 /* Long month name */ |
| #define | FMT_DATE_YEAR_DOY 0x15 /* Day of the year with no leading 0 */ |
| #define | FMT_DATE_YEAR_0 0x16 /* 2 digit year with leading 0 */ |
| #define | FMT_DATE_YEAR_LONG 0x18 /* 4 digit year */ |
| #define | FMT_DATE_MIN 0x1A /* Minutes with no leading 0 */ |
| #define | FMT_DATE_MIN_0 0x1B /* Minutes with leading 0 */ |
| #define | FMT_DATE_SEC 0x1C /* Seconds with no leading 0 */ |
| #define | FMT_DATE_SEC_0 0x1D /* Seconds with leading 0 */ |
| #define | FMT_DATE_HOUR 0x1E /* Hours with no leading 0 */ |
| #define | FMT_DATE_HOUR_0 0x1F /* Hours with leading 0 */ |
| #define | FMT_DATE_HOUR_12 0x20 /* Hours with no leading 0, 12 hour clock */ |
| #define | FMT_DATE_HOUR_12_0 0x21 /* Hours with leading 0, 12 hour clock */ |
| #define | FMT_DATE_TIME_UNK2 0x23 /* same as FMT_DATE_HOUR_0, for "short time" format */ |
| #define | FMT_DATE_AMPM_SYS1 0x2E /* AM/PM as defined by system settings */ |
| #define | FMT_DATE_AMPM_UPPER 0x2F /* Upper-case AM or PM */ |
| #define | FMT_DATE_A_UPPER 0x30 /* Upper-case A or P */ |
| #define | FMT_DATE_AMPM_SYS2 0x31 /* AM/PM as defined by system settings */ |
| #define | FMT_DATE_AMPM_LOWER 0x32 /* Lower-case AM or PM */ |
| #define | FMT_DATE_A_LOWER 0x33 /* Lower-case A or P */ |
| #define | FMT_NUM_COPY_ZERO 0x34 /* Copy 1 digit or 0 if no digit */ |
| #define | FMT_NUM_COPY_SKIP 0x35 /* Copy 1 digit or skip if no digit */ |
| #define | FMT_NUM_DECIMAL 0x36 /* Decimal separator */ |
| #define | FMT_NUM_EXP_POS_U 0x37 /* Scientific notation, uppercase, + sign */ |
| #define | FMT_NUM_EXP_NEG_U 0x38 /* Scientific notation, uppercase, - sign */ |
| #define | FMT_NUM_EXP_POS_L 0x39 /* Scientific notation, lowercase, + sign */ |
| #define | FMT_NUM_EXP_NEG_L 0x3A /* Scientific notation, lowercase, - sign */ |
| #define | FMT_NUM_CURRENCY 0x3B /* Currency symbol */ |
| #define | FMT_NUM_TRUE_FALSE 0x3D /* Convert to "True" or "False" */ |
| #define | FMT_NUM_YES_NO 0x3E /* Convert to "Yes" or "No" */ |
| #define | FMT_NUM_ON_OFF 0x3F /* Convert to "On" or "Off" */ |
| #define | FMT_STR_COPY_SPACE 0x40 /* Copy len chars with space if no char */ |
| #define | FMT_STR_COPY_SKIP 0x41 /* Copy len chars or skip if no char */ |
| #define | NEED_SPACE(x) if (cbTok < (int)(x)) return TYPE_E_BUFFERTOOSMALL; cbTok -= (x) |
| #define | COULD_BE(typ) ((!fmt_number && header->type==FMT_TYPE_UNKNOWN)||header->type==typ) |
| #define | FMT_STATE_OPEN_COPY 0x1 /* Last token written was a copy */ |
| #define | FMT_STATE_WROTE_DECIMAL 0x2 /* Already wrote a decimal separator */ |
| #define | FMT_STATE_SEEN_HOURS 0x4 /* See the hh specifier */ |
| #define | FMT_STATE_WROTE_MINUTES 0x8 /* Wrote minutes */ |
| #define | NUM_WROTE_DEC 0x01 /* Written the decimal separator */ |
| #define | NUM_WRITE_ON 0x02 /* Started to write the number */ |
| #define | NUM_WROTE_SIGN 0x04 /* Written the negative sign */ |
| #define | NUMBER_VTBITS |
| #define | GETLOCALENUMBER(type, field) |
Typedefs | |
| typedef struct tagFMT_SHORT_HEADER | FMT_SHORT_HEADER |
| typedef struct tagFMT_HEADER | FMT_HEADER |
| typedef struct tagFMT_STRING_HEADER | FMT_STRING_HEADER |
| typedef struct tagFMT_NUMBER_HEADER | FMT_NUMBER_HEADER |
| typedef struct tagFMT_DATE_HEADER | FMT_DATE_HEADER |
| typedef struct tagNAMED_FORMAT | NAMED_FORMAT |
| typedef const NAMED_FORMAT * | LPCNAMED_FORMAT |
Variables | |
| static const BYTE | fmtGeneralDate [0x0a] |
| static const BYTE | fmtShortDate [0x0a] |
| static const BYTE | fmtMediumDate [0x0a] |
| static const BYTE | fmtLongDate [0x0a] |
| static const BYTE | fmtShortTime [0x0c] |
| static const BYTE | fmtMediumTime [0x11] |
| static const BYTE | fmtLongTime [0x0d] |
| static const BYTE | fmtTrueFalse [0x0d] |
| static const BYTE | fmtYesNo [0x0d] |
| static const BYTE | fmtOnOff [0x0d] |
| static const BYTE | fmtGeneralNumber [sizeof(FMT_HEADER)] |
| static const BYTE | fmtCurrency [0x26] |
| static const BYTE | fmtFixed [0x11] |
| static const BYTE | fmtStandard [0x11] |
| static const BYTE | fmtPercent [0x15] |
| static const BYTE | fmtScientific [0x13] |
| static const NAMED_FORMAT | VARIANT_NamedFormats [] |
Definition at line 438 of file varformat.c.
Definition at line 255 of file varformat.c.
Definition at line 252 of file varformat.c.
| #define FMT_DATE_AMPM_LOWER 0x32 /* Lower-case AM or PM */ |
Definition at line 254 of file varformat.c.
Definition at line 250 of file varformat.c.
Definition at line 253 of file varformat.c.
| #define FMT_DATE_AMPM_UPPER 0x2F /* Upper-case AM or PM */ |
Definition at line 251 of file varformat.c.
Definition at line 219 of file varformat.c.
Definition at line 223 of file varformat.c.
| #define FMT_DATE_DAY_0 0x09 /* Day with leading 0 */ |
Definition at line 224 of file varformat.c.
Definition at line 230 of file varformat.c.
Definition at line 220 of file varformat.c.
Definition at line 244 of file varformat.c.
| #define FMT_DATE_HOUR_0 0x1F /* Hours with leading 0 */ |
Definition at line 245 of file varformat.c.
Definition at line 246 of file varformat.c.
Definition at line 247 of file varformat.c.
Definition at line 229 of file varformat.c.
Definition at line 240 of file varformat.c.
| #define FMT_DATE_MIN_0 0x1B /* Minutes with leading 0 */ |
Definition at line 241 of file varformat.c.
Definition at line 232 of file varformat.c.
| #define FMT_DATE_MON_0 0x12 /* Month with leading 0 */ |
Definition at line 233 of file varformat.c.
Definition at line 221 of file varformat.c.
Definition at line 242 of file varformat.c.
| #define FMT_DATE_SEC_0 0x1D /* Seconds with leading 0 */ |
Definition at line 243 of file varformat.c.
Definition at line 218 of file varformat.c.
Definition at line 222 of file varformat.c.
| #define FMT_DATE_TIME_UNK2 0x23 /* same as FMT_DATE_HOUR_0, for "short time" format */ |
Definition at line 248 of file varformat.c.
Definition at line 231 of file varformat.c.
| #define FMT_DATE_YEAR_0 0x16 /* 2 digit year with leading 0 */ |
Definition at line 237 of file varformat.c.
Definition at line 236 of file varformat.c.
| #define FMT_DATE_YEAR_LONG 0x18 /* 4 digit year */ |
Definition at line 239 of file varformat.c.
Definition at line 189 of file varformat.c.
Definition at line 187 of file varformat.c.
| #define FMT_FLAG_GT 0x2 /* Has '>' (upper case) */ |
Definition at line 170 of file varformat.c.
| #define FMT_FLAG_LT 0x1 /* Has '<' (lower case) */ |
Definition at line 169 of file varformat.c.
| #define FMT_FLAG_PERCENT 0x1 /* Has '%' (Percentage) */ |
Definition at line 186 of file varformat.c.
Definition at line 171 of file varformat.c.
Definition at line 188 of file varformat.c.
Definition at line 215 of file varformat.c.
Definition at line 217 of file varformat.c.
Definition at line 216 of file varformat.c.
Definition at line 257 of file varformat.c.
Definition at line 256 of file varformat.c.
| #define FMT_NUM_CURRENCY 0x3B /* Currency symbol */ |
Definition at line 263 of file varformat.c.
Definition at line 258 of file varformat.c.
Definition at line 262 of file varformat.c.
Definition at line 260 of file varformat.c.
Definition at line 261 of file varformat.c.
Definition at line 259 of file varformat.c.
| #define FMT_NUM_ON_OFF 0x3F /* Convert to "On" or "Off" */ |
Definition at line 266 of file varformat.c.
| #define FMT_NUM_TRUE_FALSE 0x3D /* Convert to "True" or "False" */ |
Definition at line 264 of file varformat.c.
| #define FMT_NUM_YES_NO 0x3E /* Convert to "Yes" or "No" */ |
Definition at line 265 of file varformat.c.
Definition at line 441 of file varformat.c.
Definition at line 443 of file varformat.c.
Definition at line 442 of file varformat.c.
| #define FMT_STATE_WROTE_MINUTES 0x8 /* Wrote minutes */ |
Definition at line 444 of file varformat.c.
Definition at line 268 of file varformat.c.
Definition at line 267 of file varformat.c.
Definition at line 144 of file varformat.c.
| #define FMT_TYPE_DATE 0x3 |
Definition at line 141 of file varformat.c.
| #define FMT_TYPE_GENERAL 0x1 |
Definition at line 139 of file varformat.c.
| #define FMT_TYPE_NUMBER 0x2 |
Definition at line 140 of file varformat.c.
| #define FMT_TYPE_STRING 0x4 |
Definition at line 142 of file varformat.c.
| #define FMT_TYPE_UNKNOWN 0x0 |
Definition at line 138 of file varformat.c.
Definition at line 161 of file varformat.c.
Definition at line 163 of file varformat.c.
Definition at line 160 of file varformat.c.
Definition at line 162 of file varformat.c.
Definition at line 2218 of file varformat.c.
Definition at line 45 of file varformat.c.
Definition at line 435 of file varformat.c.
Definition at line 1145 of file varformat.c.
Definition at line 1144 of file varformat.c.
Definition at line 1146 of file varformat.c.
| #define NUMBER_VTBITS |
Definition at line 2048 of file varformat.c.
| typedef struct tagFMT_DATE_HEADER FMT_DATE_HEADER |
| typedef struct tagFMT_HEADER FMT_HEADER |
| typedef const NAMED_FORMAT* LPCNAMED_FORMAT |
Definition at line 416 of file varformat.c.
| typedef struct tagNAMED_FORMAT NAMED_FORMAT |
Definition at line 418 of file varformat.c.
Referenced by VARIANT_GetNamedFormat().
| HRESULT WINAPI VarFormat | ( | LPVARIANT | pVarIn, |
| LPOLESTR | lpszFormat, | ||
| int | nFirstDay, | ||
| int | nFirstWeek, | ||
| ULONG | dwFlags, | ||
| BSTR * | pbstrOut | ||
| ) |
Definition at line 2144 of file varformat.c.
Referenced by test_VarFormat().
| HRESULT WINAPI VarFormatCurrency | ( | LPVARIANT | pVarIn, |
| INT | nDigits, | ||
| INT | nLeading, | ||
| INT | nParens, | ||
| INT | nGrouping, | ||
| ULONG | dwFlags, | ||
| BSTR * | pbstrOut | ||
| ) |
Definition at line 2424 of file varformat.c.
Referenced by Global_FormatCurrency(), and test_VarFormatCurrency().
Definition at line 2196 of file varformat.c.
Referenced by Global_FormatDateTime(), and test_VarFormatDateTime().
| HRESULT WINAPI VarFormatFromTokens | ( | LPVARIANT | pVarIn, |
| LPOLESTR | lpszFormat, | ||
| LPBYTE | rgbTok, | ||
| ULONG | dwFlags, | ||
| BSTR * | pbstrOut, | ||
| LCID | lcid | ||
| ) |
Definition at line 2056 of file varformat.c.
Referenced by test_VarFormatFromTokens(), VarFormat(), and VarFormatDateTime().
| HRESULT WINAPI VarFormatNumber | ( | LPVARIANT | pVarIn, |
| INT | nDigits, | ||
| INT | nLeading, | ||
| INT | nParens, | ||
| INT | nGrouping, | ||
| ULONG | dwFlags, | ||
| BSTR * | pbstrOut | ||
| ) |
Definition at line 2247 of file varformat.c.
Referenced by Global_FormatNumber(), test_VarFormatNumber(), and VarFormatPercent().
| HRESULT WINAPI VarFormatPercent | ( | LPVARIANT | pVarIn, |
| INT | nDigits, | ||
| INT | nLeading, | ||
| INT | nParens, | ||
| INT | nGrouping, | ||
| ULONG | dwFlags, | ||
| BSTR * | pbstrOut | ||
| ) |
Definition at line 2351 of file varformat.c.
Referenced by Global_FormatPercent().
|
static |
Definition at line 1561 of file varformat.c.
Referenced by VarFormatFromTokens().
|
static |
Definition at line 1149 of file varformat.c.
Referenced by VarFormatFromTokens().
|
static |
Definition at line 1923 of file varformat.c.
Referenced by VarFormatFromTokens().
Definition at line 423 of file varformat.c.
Referenced by VarTokenizeFormatString().
Definition at line 2532 of file varformat.c.
Referenced by Global_MonthName().
| HRESULT WINAPI VarTokenizeFormatString | ( | LPOLESTR | lpszFormat, |
| LPBYTE | rgbTok, | ||
| int | cbTok, | ||
| int | nFirstDay, | ||
| int | nFirstWeek, | ||
| LCID | lcid, | ||
| int * | pcbActual | ||
| ) |
Definition at line 475 of file varformat.c.
Referenced by test_VarFormatFromTokens(), and VarFormat().
| HRESULT WINAPI VarWeekdayName | ( | INT | iWeekday, |
| INT | fAbbrev, | ||
| INT | iFirstDay, | ||
| ULONG | dwFlags, | ||
| BSTR * | pbstrOut | ||
| ) |
Definition at line 2583 of file varformat.c.
Referenced by Global_WeekdayName(), and test_VarWeekdayName().
| WINE_DEFAULT_DEBUG_CHANNEL | ( | variant | ) |
Definition at line 347 of file varformat.c.
Definition at line 361 of file varformat.c.
Definition at line 271 of file varformat.c.
Referenced by VarFormatDateTime().
|
static |
Definition at line 342 of file varformat.c.
Definition at line 292 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 314 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 285 of file varformat.c.
Definition at line 306 of file varformat.c.
Definition at line 335 of file varformat.c.
Definition at line 375 of file varformat.c.
Definition at line 383 of file varformat.c.
Definition at line 278 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 299 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 368 of file varformat.c.
Definition at line 321 of file varformat.c.
Definition at line 328 of file varformat.c.
|
static |
Definition at line 397 of file varformat.c.
Referenced by VARIANT_GetNamedFormat().