ReactOS 0.4.16-dev-297-gc569aee
|
#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 WCHAR | szPercent_d [] = { '%','d','\0' } |
static const WCHAR | szPercentZeroTwo_d [] = { '%','0','2','d','\0' } |
static const WCHAR | szPercentZeroStar_d [] = { '%','0','*','d','\0' } |
static const WCHAR | szGeneralDate [] = { 'G','e','n','e','r','a','l',' ','D','a','t','e','\0' } |
static const BYTE | fmtGeneralDate [0x0a] |
static const WCHAR | szShortDate [] = { 'S','h','o','r','t',' ','D','a','t','e','\0' } |
static const BYTE | fmtShortDate [0x0a] |
static const WCHAR | szMediumDate [] = { 'M','e','d','i','u','m',' ','D','a','t','e','\0' } |
static const BYTE | fmtMediumDate [0x0a] |
static const WCHAR | szLongDate [] = { 'L','o','n','g',' ','D','a','t','e','\0' } |
static const BYTE | fmtLongDate [0x0a] |
static const WCHAR | szShortTime [] = { 'S','h','o','r','t',' ','T','i','m','e','\0' } |
static const BYTE | fmtShortTime [0x0c] |
static const WCHAR | szMediumTime [] = { 'M','e','d','i','u','m',' ','T','i','m','e','\0' } |
static const BYTE | fmtMediumTime [0x11] |
static const WCHAR | szLongTime [] = { 'L','o','n','g',' ','T','i','m','e','\0' } |
static const BYTE | fmtLongTime [0x0d] |
static const WCHAR | szTrueFalse [] = { 'T','r','u','e','/','F','a','l','s','e','\0' } |
static const BYTE | fmtTrueFalse [0x0d] |
static const WCHAR | szYesNo [] = { 'Y','e','s','/','N','o','\0' } |
static const BYTE | fmtYesNo [0x0d] |
static const WCHAR | szOnOff [] = { 'O','n','/','O','f','f','\0' } |
static const BYTE | fmtOnOff [0x0d] |
static const WCHAR | szGeneralNumber [] = { 'G','e','n','e','r','a','l',' ','N','u','m','b','e','r','\0' } |
static const BYTE | fmtGeneralNumber [sizeof(FMT_HEADER)] |
static const WCHAR | szCurrency [] = { 'C','u','r','r','e','n','c','y','\0' } |
static const BYTE | fmtCurrency [0x26] |
static const WCHAR | szFixed [] = { 'F','i','x','e','d','\0' } |
static const BYTE | fmtFixed [0x11] |
static const WCHAR | szStandard [] = { 'S','t','a','n','d','a','r','d','\0' } |
static const BYTE | fmtStandard [0x11] |
static const WCHAR | szPercent [] = { 'P','e','r','c','e','n','t','\0' } |
static const BYTE | fmtPercent [0x15] |
static const WCHAR | szScientific [] = { 'S','c','i','e','n','t','i','f','i','c','\0' } |
static const BYTE | fmtScientific [0x13] |
static const NAMED_FORMAT | VARIANT_NamedFormats [] |
Definition at line 458 of file varformat.c.
Definition at line 259 of file varformat.c.
Definition at line 256 of file varformat.c.
#define FMT_DATE_AMPM_LOWER 0x32 /* Lower-case AM or PM */ |
Definition at line 258 of file varformat.c.
Definition at line 254 of file varformat.c.
Definition at line 257 of file varformat.c.
#define FMT_DATE_AMPM_UPPER 0x2F /* Upper-case AM or PM */ |
Definition at line 255 of file varformat.c.
Definition at line 223 of file varformat.c.
Definition at line 227 of file varformat.c.
#define FMT_DATE_DAY_0 0x09 /* Day with leading 0 */ |
Definition at line 228 of file varformat.c.
Definition at line 234 of file varformat.c.
Definition at line 224 of file varformat.c.
Definition at line 248 of file varformat.c.
#define FMT_DATE_HOUR_0 0x1F /* Hours with leading 0 */ |
Definition at line 249 of file varformat.c.
Definition at line 250 of file varformat.c.
Definition at line 251 of file varformat.c.
Definition at line 233 of file varformat.c.
Definition at line 244 of file varformat.c.
#define FMT_DATE_MIN_0 0x1B /* Minutes with leading 0 */ |
Definition at line 245 of file varformat.c.
Definition at line 236 of file varformat.c.
#define FMT_DATE_MON_0 0x12 /* Month with leading 0 */ |
Definition at line 237 of file varformat.c.
Definition at line 225 of file varformat.c.
Definition at line 246 of file varformat.c.
#define FMT_DATE_SEC_0 0x1D /* Seconds with leading 0 */ |
Definition at line 247 of file varformat.c.
Definition at line 222 of file varformat.c.
Definition at line 226 of file varformat.c.
#define FMT_DATE_TIME_UNK2 0x23 /* same as FMT_DATE_HOUR_0, for "short time" format */ |
Definition at line 252 of file varformat.c.
Definition at line 235 of file varformat.c.
#define FMT_DATE_YEAR_0 0x16 /* 2 digit year with leading 0 */ |
Definition at line 241 of file varformat.c.
Definition at line 240 of file varformat.c.
#define FMT_DATE_YEAR_LONG 0x18 /* 4 digit year */ |
Definition at line 243 of file varformat.c.
Definition at line 193 of file varformat.c.
Definition at line 191 of file varformat.c.
#define FMT_FLAG_GT 0x2 /* Has '>' (upper case) */ |
Definition at line 174 of file varformat.c.
#define FMT_FLAG_LT 0x1 /* Has '<' (lower case) */ |
Definition at line 173 of file varformat.c.
#define FMT_FLAG_PERCENT 0x1 /* Has '%' (Percentage) */ |
Definition at line 190 of file varformat.c.
Definition at line 175 of file varformat.c.
Definition at line 192 of file varformat.c.
Definition at line 219 of file varformat.c.
Definition at line 221 of file varformat.c.
Definition at line 220 of file varformat.c.
Definition at line 261 of file varformat.c.
Definition at line 260 of file varformat.c.
#define FMT_NUM_CURRENCY 0x3B /* Currency symbol */ |
Definition at line 267 of file varformat.c.
Definition at line 262 of file varformat.c.
Definition at line 266 of file varformat.c.
Definition at line 264 of file varformat.c.
Definition at line 265 of file varformat.c.
Definition at line 263 of file varformat.c.
#define FMT_NUM_ON_OFF 0x3F /* Convert to "On" or "Off" */ |
Definition at line 270 of file varformat.c.
#define FMT_NUM_TRUE_FALSE 0x3D /* Convert to "True" or "False" */ |
Definition at line 268 of file varformat.c.
#define FMT_NUM_YES_NO 0x3E /* Convert to "Yes" or "No" */ |
Definition at line 269 of file varformat.c.
Definition at line 461 of file varformat.c.
#define FMT_STATE_SEEN_HOURS 0x4 /* See the hh specifier */ |
Definition at line 463 of file varformat.c.
Definition at line 462 of file varformat.c.
#define FMT_STATE_WROTE_MINUTES 0x8 /* Wrote minutes */ |
Definition at line 464 of file varformat.c.
Definition at line 272 of file varformat.c.
Definition at line 271 of file varformat.c.
Definition at line 148 of file varformat.c.
#define FMT_TYPE_DATE 0x3 |
Definition at line 145 of file varformat.c.
#define FMT_TYPE_GENERAL 0x1 |
Definition at line 143 of file varformat.c.
#define FMT_TYPE_NUMBER 0x2 |
Definition at line 144 of file varformat.c.
#define FMT_TYPE_STRING 0x4 |
Definition at line 146 of file varformat.c.
#define FMT_TYPE_UNKNOWN 0x0 |
Definition at line 142 of file varformat.c.
Definition at line 165 of file varformat.c.
Definition at line 167 of file varformat.c.
Definition at line 164 of file varformat.c.
Definition at line 166 of file varformat.c.
Definition at line 2212 of file varformat.c.
Definition at line 45 of file varformat.c.
Definition at line 455 of file varformat.c.
Definition at line 1165 of file varformat.c.
Definition at line 1164 of file varformat.c.
Definition at line 1166 of file varformat.c.
#define NUMBER_VTBITS |
Definition at line 2042 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 436 of file varformat.c.
typedef struct tagNAMED_FORMAT NAMED_FORMAT |
Definition at line 438 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 2138 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 2420 of file varformat.c.
Definition at line 2190 of file varformat.c.
HRESULT WINAPI VarFormatFromTokens | ( | LPVARIANT | pVarIn, |
LPOLESTR | lpszFormat, | ||
LPBYTE | rgbTok, | ||
ULONG | dwFlags, | ||
BSTR * | pbstrOut, | ||
LCID | lcid | ||
) |
Definition at line 2050 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 2241 of file varformat.c.
Referenced by test_VarFormatNumber(), and VarFormatPercent().
HRESULT WINAPI VarFormatPercent | ( | LPVARIANT | pVarIn, |
INT | nDigits, | ||
INT | nLeading, | ||
INT | nParens, | ||
INT | nGrouping, | ||
ULONG | dwFlags, | ||
BSTR * | pbstrOut | ||
) |
Definition at line 2345 of file varformat.c.
|
static |
Definition at line 1581 of file varformat.c.
Referenced by VarFormatFromTokens().
|
static |
Definition at line 1169 of file varformat.c.
Referenced by VarFormatFromTokens().
|
static |
Definition at line 1917 of file varformat.c.
Referenced by VarFormatFromTokens().
Definition at line 443 of file varformat.c.
Referenced by VarTokenizeFormatString().
Definition at line 2517 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 495 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 2568 of file varformat.c.
Referenced by Global_WeekdayName(), and test_VarWeekdayName().
WINE_DEFAULT_DEBUG_CHANNEL | ( | variant | ) |
Definition at line 363 of file varformat.c.
Definition at line 378 of file varformat.c.
Definition at line 276 of file varformat.c.
Referenced by VarFormatDateTime().
|
static |
Definition at line 357 of file varformat.c.
Definition at line 300 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 325 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 292 of file varformat.c.
Definition at line 316 of file varformat.c.
Definition at line 349 of file varformat.c.
Definition at line 394 of file varformat.c.
Definition at line 403 of file varformat.c.
Definition at line 284 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 308 of file varformat.c.
Referenced by VarFormatDateTime().
Definition at line 386 of file varformat.c.
Definition at line 333 of file varformat.c.
Definition at line 341 of file varformat.c.
Definition at line 362 of file varformat.c.
Definition at line 377 of file varformat.c.
Definition at line 275 of file varformat.c.
|
static |
Definition at line 356 of file varformat.c.
Definition at line 299 of file varformat.c.
Definition at line 324 of file varformat.c.
Definition at line 291 of file varformat.c.
Definition at line 315 of file varformat.c.
Definition at line 348 of file varformat.c.
Definition at line 393 of file varformat.c.
Referenced by PagePrompt(), and VarFormatPercent().
Definition at line 47 of file varformat.c.
Referenced by VARIANT_FormatDate().
Definition at line 49 of file varformat.c.
Referenced by VARIANT_FormatNumber().
Definition at line 48 of file varformat.c.
Referenced by VARIANT_FormatDate().
Definition at line 402 of file varformat.c.
Definition at line 283 of file varformat.c.
Definition at line 307 of file varformat.c.
Definition at line 385 of file varformat.c.
Definition at line 332 of file varformat.c.
Definition at line 340 of file varformat.c.
|
static |
Definition at line 417 of file varformat.c.
Referenced by VARIANT_GetNamedFormat().