summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Zeller <luz@plan44.ch>2011-01-27 12:22:08 +0100
committerLukas Zeller <luz@plan44.ch>2011-01-27 12:22:08 +0100
commit3b6f256cde871f9b954b3a83fee71a344890168f (patch)
tree488405d55fceb6fdf3d4955332121151238c4575
parent83d9289ecb904e4837392affe0f4aed76861b8ed (diff)
mimedir: more generic solution for conversion options (instead of special modes like BDAY, which is removed again)
In <value>, the "conversion" attribute now can not only contain the basic conversion mode, but also some options, which are appended with a + sign: <value field="BDAY" conversion="DATE+EXTFMT"/> The defined options so far are: - EXTFMT: display dates and times in ISO8601 extended format - MILLISEC: show time with millisecond resolution
-rw-r--r--src/sysync/mimedirprofile.cpp176
-rwxr-xr-xsrc/sysync/mimedirprofile.h78
-rwxr-xr-xsrc/sysync/vcalendaritemtype.h4
3 files changed, 142 insertions, 116 deletions
diff --git a/src/sysync/mimedirprofile.cpp b/src/sysync/mimedirprofile.cpp
index a96dd84..773bcb1 100644
--- a/src/sysync/mimedirprofile.cpp
+++ b/src/sysync/mimedirprofile.cpp
@@ -133,50 +133,74 @@ TProfileHandler *TMIMEProfileConfig::newProfileHandler(TMultiFieldItemType *aIte
// get conversion mode, virtual, can be overridden by derivates
-bool TMIMEProfileConfig::getConvMode(const char *aText, sInt16 &aConvMode)
+bool TMIMEProfileConfig::getConvMode(cAppCharP aText, sInt16 &aConvMode)
{
- // basic modes
- if (strucmp(aText,"none")==0)
- aConvMode=CONVMODE_NONE;
- else if (strucmp(aText,"version")==0)
- aConvMode=CONVMODE_VERSION;
- else if (strucmp(aText,"prodid")==0)
- aConvMode=CONVMODE_PRODID;
- else if (strucmp(aText,"timestamp")==0)
- aConvMode=CONVMODE_TIMESTAMP;
- else if (strucmp(aText,"date")==0)
- aConvMode=CONVMODE_DATE;
- else if (strucmp(aText,"autodate")==0)
- aConvMode=CONVMODE_AUTODATE;
- else if (strucmp(aText,"autoenddate")==0)
- aConvMode=CONVMODE_AUTOENDDATE;
- else if (strucmp(aText,"tz")==0)
- aConvMode=CONVMODE_TZ;
- else if (strucmp(aText,"daylight")==0)
- aConvMode=CONVMODE_DAYLIGHT;
- else if (strucmp(aText,"tzid")==0)
- aConvMode=CONVMODE_TZID;
- else if (strucmp(aText,"emptyonly")==0)
- aConvMode=CONVMODE_EMPTYONLY;
- else if (strucmp(aText,"bitmap")==0)
- aConvMode=CONVMODE_BITMAP;
- else if (strucmp(aText,"multimix")==0)
- aConvMode=CONVMODE_MULTIMIX;
- else if (strucmp(aText,"blob_b64")==0)
- aConvMode=CONVMODE_BLOB_B64;
- else if (strucmp(aText,"mailto")==0)
- aConvMode=CONVMODE_MAILTO;
- else if (strucmp(aText,"valuetype")==0)
- aConvMode=CONVMODE_VALUETYPE;
- else if (strucmp(aText,"fullvaluetype")==0)
- aConvMode=CONVMODE_FULLVALUETYPE;
- else if (strucmp(aText,"rrule")==0)
- aConvMode=CONVMODE_RRULE;
- else if (strucmp(aText,"bday")==0)
- aConvMode=CONVMODE_BDAY;
+ // separate options
+ size_t n=0; // no size
+ cAppCharP op = strchr(aText, '+');
+ if (op) n = op-aText;
+ // check basic modes
+ if (op && n==0) {
+ // only options, no basic mode
+ aConvMode = CONVMODE_NONE;
+ }
else {
- fail("'conversion' value '%s' is invalid",aText);
- return false;
+ // first item is basic mode
+ if (strucmp(aText,"none",n)==0)
+ aConvMode = CONVMODE_NONE;
+ else if (strucmp(aText,"version",n)==0)
+ aConvMode = CONVMODE_VERSION;
+ else if (strucmp(aText,"prodid",n)==0)
+ aConvMode = CONVMODE_PRODID;
+ else if (strucmp(aText,"timestamp",n)==0)
+ aConvMode = CONVMODE_TIMESTAMP;
+ else if (strucmp(aText,"date",n)==0)
+ aConvMode = CONVMODE_DATE;
+ else if (strucmp(aText,"autodate",n)==0)
+ aConvMode = CONVMODE_AUTODATE;
+ else if (strucmp(aText,"autoenddate",n)==0)
+ aConvMode = CONVMODE_AUTOENDDATE;
+ else if (strucmp(aText,"tz",n)==0)
+ aConvMode = CONVMODE_TZ;
+ else if (strucmp(aText,"daylight",n)==0)
+ aConvMode = CONVMODE_DAYLIGHT;
+ else if (strucmp(aText,"tzid",n)==0)
+ aConvMode = CONVMODE_TZID;
+ else if (strucmp(aText,"emptyonly",n)==0)
+ aConvMode = CONVMODE_EMPTYONLY;
+ else if (strucmp(aText,"bitmap",n)==0)
+ aConvMode = CONVMODE_BITMAP;
+ else if (strucmp(aText,"multimix",n)==0)
+ aConvMode = CONVMODE_MULTIMIX;
+ else if (strucmp(aText,"blob_b64",n)==0)
+ aConvMode = CONVMODE_BLOB_B64;
+ else if (strucmp(aText,"mailto",n)==0)
+ aConvMode = CONVMODE_MAILTO;
+ else if (strucmp(aText,"valuetype",n)==0)
+ aConvMode = CONVMODE_VALUETYPE;
+ else if (strucmp(aText,"fullvaluetype",n)==0)
+ aConvMode = CONVMODE_FULLVALUETYPE;
+ else if (strucmp(aText,"rrule",n)==0)
+ aConvMode = CONVMODE_RRULE;
+ else {
+ fail("'conversion' value '%s' is invalid",aText);
+ return false;
+ }
+ }
+ // now check for options flags and or them into conversion value
+ while (op) {
+ aText = op+1; // skip +
+ n = 0;
+ op = strchr(aText, '+');
+ if (op) n = op-aText;
+ if (strucmp(aText,"extfmt",n)==0)
+ aConvMode |= CONVMODE_FLAG_EXTFMT;
+ else if (strucmp(aText,"millisec",n)==0)
+ aConvMode |= CONVMODE_FLAG_MILLISEC;
+ else {
+ fail("'conversion' option '%s' is invalid",aText);
+ return false;
+ }
}
return true;
} // TMIMEProfileConfig::getConvMode
@@ -426,12 +450,12 @@ bool TMIMEProfileConfig::localStartElement(const char *aElementName, const char
// <value field="N_FIRST" conversion="none" combine="no"/>
// - set default options
fid=FID_NOT_SUPPORTED;
- convmode=CONVMODE_NONE;
- combsep=0;
+ convmode = CONVMODE_NONE;
+ combsep = 0;
// - get other options of convdef
if (!getConvAttrs(aAttributes,fid,convmode,combsep)) return true; // failed
// - set convdef
- fOpenConvDef=fOpenParameter->setConvDef(fid,convmode,combsep);
+ fOpenConvDef = fOpenParameter->setConvDef(fid,convmode,combsep);
startNestedParsing();
}
else if (strucmp(aElementName,"position")==0) {
@@ -457,13 +481,13 @@ bool TMIMEProfileConfig::localStartElement(const char *aElementName, const char
return fail("'index' out of range (0..%hd)",fOpenProperty->numValues);
// - set default options
fid=FID_NOT_SUPPORTED;
- convmode=CONVMODE_NONE;
- combsep=0;
+ convmode = CONVMODE_NONE;
+ combsep = 0;
// - get other options of convdef
if (!getConvAttrs(aAttributes,fid,convmode,combsep))
return true; // failed
// - set convdef
- fOpenConvDef=fOpenProperty->setConvDef(idx,fid,convmode,combsep);
+ fOpenConvDef = fOpenProperty->setConvDef(idx,fid,convmode,combsep);
startNestedParsing();
}
else if (strucmp(aElementName,"parameter")==0) {
@@ -1334,7 +1358,7 @@ static bool mixvalparse(cAppCharP aMixVal, uInt16 &aOffs, bool &aIsBitMap, uInt1
// to a given convdef (for multi-field conversion modes such as CONVMODE_RRULE
sInt16 TMimeDirProfileHandler::fieldBlockSize(const TConversionDef &aConvDef)
{
- if (aConvDef.convmode==CONVMODE_RRULE)
+ if ((aConvDef.convmode & CONVMODE_MASK)==CONVMODE_RRULE)
return 6; // RRULE fieldblock: DTSTART,FREQ,INTERVAL,FIRSTMASK,LASTMASK,UNTIL = 6 fields
else
return 1; // single field
@@ -1383,8 +1407,10 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
bool dateonly = false; // assume timestamp mode
bool autodate = true; // show date-only values automatically as date-only, even if stored in a timestamp field
- bool extFmt = false; // not extended ISO8601 date formats by default
- switch (aConvDefP->convmode) {
+ bool extFmt = (aConvDefP->convmode & CONVMODE_FLAG_EXTFMT)!=0;
+ bool milliSec = (aConvDefP->convmode & CONVMODE_FLAG_MILLISEC)!=0;
+ sInt16 convmode = aConvDefP->convmode & CONVMODE_MASK;
+ switch (convmode) {
// no special mode
case CONVMODE_NONE:
case CONVMODE_EMPTYONLY:
@@ -1398,8 +1424,6 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
else
goto timestamp; // others are treated as timestamps
// date & time modes
- case CONVMODE_BDAY: // as date with extended format
- extFmt = true; // special case, BDAY is rendered in extended format
case CONVMODE_DATE: // always show as date
dateonly:
dateonly = true; // render as date in all cases
@@ -1425,11 +1449,11 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
// check for special cases
if (TCTX_IS_DURATION(tctx)) {
// duration is shown as such
- tsFldP->getAsISO8601(aString, TCTX_UNKNOWN | TCTX_DURATION, false, false, extFmt, false);
+ tsFldP->getAsISO8601(aString, TCTX_UNKNOWN | TCTX_DURATION, false, false, extFmt, milliSec);
}
else if (dateonly) {
// date-only are either floating or shown as date-only part of original timestamp
- tsFldP->getAsISO8601(aString, TCTX_UNKNOWN | TCTX_DATEONLY, false, false, extFmt, false);
+ tsFldP->getAsISO8601(aString, TCTX_UNKNOWN | TCTX_DATEONLY, false, false, extFmt, milliSec);
}
else if (fReceiverCanHandleUTC && !tsFldP->isFloating()) {
// remote can handle UTC and the timestamp is not floating
@@ -1437,11 +1461,11 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
// if we have rendered a TZID for this property, this means that apparently the remote
// supports TZID (otherwise the field would not be marked available in the devInf).
// - show it as floating, explicitly with both date AND time (both flags set)
- tsFldP->getAsISO8601(aString, TCTX_UNKNOWN | TCTX_TIMEONLY | TCTX_DATEONLY, false, false, extFmt, false);
+ tsFldP->getAsISO8601(aString, TCTX_UNKNOWN | TCTX_TIMEONLY | TCTX_DATEONLY, false, false, extFmt, milliSec);
}
else {
// - show it as UTC
- tsFldP->getAsISO8601(aString, TCTX_UTC, true, false, extFmt, false);
+ tsFldP->getAsISO8601(aString, TCTX_UTC, true, false, extFmt, milliSec);
}
}
else {
@@ -1458,16 +1482,16 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
}
// first check for auto-end-date (which must be floating)
// Note: we don't get here with a date only mimo_standard because it will be catched above, so test is not really needed
- if (aConvDefP->convmode==CONVMODE_AUTOENDDATE && fVCal10EnddatesSameDay && TCTX_IS_DATEONLY(tctx) && fMimeDirMode==mimo_old)
+ if (convmode==CONVMODE_AUTOENDDATE && fVCal10EnddatesSameDay && TCTX_IS_DATEONLY(tctx) && fMimeDirMode==mimo_old)
ts-=1; // subtract one unit to make end show last time unit of previous day
// now show as floating ISO8601
- TimestampToISO8601Str(aString, ts, TCTX_UNKNOWN, extFmt, false);
+ TimestampToISO8601Str(aString, ts, TCTX_UNKNOWN, extFmt, milliSec);
}
}
else {
// not floating (=not a enddateonly), but we can't send UTC - render as localtime
// in item time zone (which defaults to session time zone)
- tsFldP->getAsISO8601(aString, fItemTimeContext, false, false, extFmt, false);
+ tsFldP->getAsISO8601(aString, fItemTimeContext, false, false, extFmt, milliSec);
}
}
return true; // found
@@ -1522,7 +1546,7 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
tctx = fItemTimeContext; // use item zone
}
// now render context as selected
- if (aConvDefP->convmode==CONVMODE_TZID) {
+ if (convmode==CONVMODE_TZID) {
// time zone ID for iCal 2.0 TZID parameter
// - make sure meta context is resolved (we don't want "SYSTEM" as TZID!)
if (!TzResolveMetaContext(tctx, getSessionZones())) return false; // cannot resolve, no time zone ID
@@ -1557,14 +1581,14 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
}
// - get resolved TZ offset and DAYLIGHT string for vCal 1.0
ContextToTzDaylight(tctx,ts,s,tctx,getSessionZones());
- if (aConvDefP->convmode==CONVMODE_TZ) {
+ if (convmode==CONVMODE_TZ) {
// time zone in +/-hh[:mm] format for vCal 1.0 TZ property
// - render offset in extended format
aString.erase();
// - return true only if we actually have a TZ
return ContextToISO8601StrAppend(aString, tctx, true);
}
- else if (aConvDefP->convmode==CONVMODE_DAYLIGHT) {
+ else if (convmode==CONVMODE_DAYLIGHT) {
// TZ and DAYLIGHT property for vCal 1.0
aString = s;
// - return true only if we actually have a DAYLIGHT
@@ -1594,7 +1618,7 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
else if (TCTX_IS_TIMEONLY(tctx)) aString="TIME";
else {
// only show type if full value type requested
- if (aConvDefP->convmode==CONVMODE_FULLVALUETYPE)
+ if (convmode==CONVMODE_FULLVALUETYPE)
aString="DATE-TIME";
else
return false; // we don't need a VALUE param for normal datetimes
@@ -1660,7 +1684,7 @@ bool TMimeDirProfileHandler::fieldToMIMEString(
// create bit representation
if (!aString.empty() && aConvDefP->combineSep)
aString+=aConvDefP->combineSep; // separator first if not first item
- if (aConvDefP->convmode==CONVMODE_MULTIMIX) {
+ if (convmode==CONVMODE_MULTIMIX) {
// multimix mode, use full syntax
if (mixOffs[i]>0)
StringObjAppendPrintf(aString,"%d.",mixOffs[i]);
@@ -2235,7 +2259,7 @@ sInt16 TMimeDirProfileHandler::generateValue(
maxSiz = 0; // no size restriction
bool noTruncate=aItem.getTargetItemType()->getFieldOptions(fid)->notruncate;
// check for BLOB values
- if (aConvDefP->convmode==CONVMODE_BLOB_B64) {
+ if ((aConvDefP->convmode & CONVMODE_MASK)==CONVMODE_BLOB_B64) {
// no value lists, escaping, enums. Simply set value and encoding
TItemField *fldP = aItem.getArrayField(fid,aRepOffset,true); // existing array elements only
if (!fldP) return GENVALUE_EXHAUSTED; // no leaf field - must be exhausted array (fldP==NULL is not possible here for non-arrays)
@@ -2864,7 +2888,7 @@ sInt16 TMimeDirProfileHandler::generateProperty(
v>0 ? aPropP->valuesep : 0, // separate with specified multi-value-delimiter if not first value
numNonSpcs, // number of consecutive non-spaces, accumulated
aPropP->allowFoldAtSep,
- convP->convmode==CONVMODE_RRULE // RRULES are not to be escaped
+ (convP->convmode & CONVMODE_MASK)==CONVMODE_RRULE // RRULES are not to be escaped
);
// check if something was generated
if (genres>=GENVALUE_ELEMENT) {
@@ -2921,7 +2945,7 @@ sInt16 TMimeDirProfileHandler::generateProperty(
0, // no first char
numNonSpcs, // number of consecutive non-spaces, accumulated
aPropP->allowFoldAtSep,
- convP->convmode==CONVMODE_RRULE // RRULES are not to be escaped
+ (convP->convmode & CONVMODE_MASK)==CONVMODE_RRULE // RRULES are not to be escaped
);
//* %%% */ PDEBUGPRINTFX(DBG_EXOTIC,("generateValue #%hd for property '%s' returns genres==%hd",v,TCFG_CSTR(aPropP->propname),genres));
// check if something was generated
@@ -3268,7 +3292,8 @@ bool TMimeDirProfileHandler::MIMEStringToField(
// get pointer to leaf field
TItemField *fldP = aItem.getArrayField(aFid,aArrIndex);
- switch (aConvDefP->convmode) {
+ sInt16 convmode = aConvDefP->convmode & CONVMODE_MASK;
+ switch (convmode) {
case CONVMODE_MAILTO:
// remove the mailto: prefix if there is one
if (strucmp(aText,"mailto:",7)==0)
@@ -3282,7 +3307,6 @@ bool TMimeDirProfileHandler::MIMEStringToField(
case CONVMODE_TIMESTAMP: // nothing special for parsing
case CONVMODE_AUTODATE: // nothing special for parsing
case CONVMODE_AUTOENDDATE: // check for "last minute of the day"
- case CONVMODE_BDAY: // as date with extended format, parses like CONVMODE_DATE
case CONVMODE_DATE: // dates will be made floating
case CONVMODE_NONE:
normal:
@@ -3366,10 +3390,10 @@ bool TMimeDirProfileHandler::MIMEStringToField(
}
}
// special conversions
- if (aConvDefP->convmode==CONVMODE_DATE || aConvDefP->convmode==CONVMODE_BDAY) {
+ if (convmode==CONVMODE_DATE) {
tsFldP->makeFloating(); // date-only is forced floating
}
- else if (aConvDefP->convmode==CONVMODE_AUTOENDDATE && fMimeDirMode==mimo_old) {
+ else if (convmode==CONVMODE_AUTOENDDATE && fMimeDirMode==mimo_old) {
// check if this could be a 23:59 type end-of-day
lineartime_t ts = tsFldP->getTimestampAs(fItemTimeContext,&tctx); // get in item context or floating
lineartime_t ts0 = lineartime2dateonlyTime(ts);
@@ -3461,7 +3485,7 @@ bool TMimeDirProfileHandler::MIMEStringToField(
case CONVMODE_MULTIMIX:
case CONVMODE_BITMAP:
while (*aText && *aText==' ') aText++; // skip leading spaces
- if (aConvDefP->convmode==CONVMODE_MULTIMIX) {
+ if (convmode==CONVMODE_MULTIMIX) {
// parse value to determine field
if (!mixvalparse(aText, offs, isBitMap, n)) return true; // syntax not ok, nop
fldP = aItem.getArrayField(aFid+offs,aArrIndex);
@@ -3623,7 +3647,7 @@ bool TMimeDirProfileHandler::parseValue(
// find out if value exists (available in source and target)
if (isFieldAvailable(aItem,fid)) {
// parse only if field available in both source and target
- if (aConvDefP->convmode==CONVMODE_BLOB_B64) {
+ if ((aConvDefP->convmode & CONVMODE_MASK)==CONVMODE_BLOB_B64) {
// move 1:1 into field
// - get pointer to leaf field
TItemField *fldP = aItem.getArrayField(fid,aRepOffset);
@@ -4976,7 +5000,7 @@ void TMimeDirProfileHandler::enumerateProperties(const TProfileDefinition *aProf
}
// - add property data descriptor
propdataP->prop = newDevInfCTData(TCFG_CSTR(propP->propname),sz,noTruncate,maxOccur,dataType);
- if (propP->convdefs && propP->convdefs->convmode==CONVMODE_VERSION) {
+ if (propP->convdefs && (propP->convdefs->convmode & CONVMODE_MASK)==CONVMODE_VERSION) {
// special case: add version valenum
addPCDataStringToList(aItemTypeP->getTypeVers(),&(propdataP->prop->valenum));
}
@@ -5010,7 +5034,7 @@ void TMimeDirProfileHandler::enumeratePropFilters(const TProfileDefinition *aPro
if (
propP->canFilter &&
(propP->showInCTCap || aProfileP==aSelectedProfileP) &&
- propP->convdefs && propP->convdefs[0].convmode!=CONVMODE_VERSION && propP->convdefs[0].convmode!=CONVMODE_PRODID
+ propP->convdefs && (propP->convdefs[0].convmode & CONVMODE_MASK)!=CONVMODE_VERSION && (propP->convdefs[0].convmode & CONVMODE_MASK)!=CONVMODE_PRODID
) {
// Note: properties of explicitly selected (sub)profiles will be shown anyway,
// as only purpose of suppressing properties in devInf is to avoid
diff --git a/src/sysync/mimedirprofile.h b/src/sysync/mimedirprofile.h
index 87e0cef..c5845ef 100755
--- a/src/sysync/mimedirprofile.h
+++ b/src/sysync/mimedirprofile.h
@@ -24,6 +24,13 @@
namespace sysync {
+// conversion mode is a basic value plus some optional flags
+#define CONVMODE_MASK 0xFF // 8 bits for basic convmode
+
+// flags
+#define CONVMODE_FLAG_EXTFMT 0x0100 // use ISO8601 extended format for rendering date and time
+#define CONVMODE_FLAG_MILLISEC 0x0200 // render milliseconds
+
// special field conversion modes
#define CONVMODE_NONE 0 // no conversion (just string copy), but includes value list parsing and enum conversion
#define CONVMODE_VERSION 1 // version
@@ -48,7 +55,6 @@ namespace sysync {
// define those that we want to implement (also work as getConfMode conditionals)
#define CONVMODE_RRULE CONVMODE_MIME_DERIVATES+0 // RRULE, needs RRULE field block
-#define CONVMODE_BDAY CONVMODE_MIME_DERIVATES+1 // like CONVMODE_DATE, but with
// special numvals
@@ -67,7 +73,7 @@ typedef enum {
// VTIMEZONE generation mode (what timezone definition rules to include)
typedef enum {
- vtzgen_current,
+ vtzgen_current,
vtzgen_start,
vtzgen_end,
vtzgen_range,
@@ -77,7 +83,7 @@ typedef enum {
typedef enum {
- tzidgen_default,
+ tzidgen_default,
tzidgen_olson,
numTzIdGenModes
} TTzIdGenMode;
@@ -96,7 +102,7 @@ class TRemoteRuleConfig;
// enumeration modes
typedef enum {
enm_translate, // translation from value to name and vice versa
- enm_prefix, // enumtext/enumval are prefixes of
+ enm_prefix, // enumtext/enumval are prefixes of
enm_default_name, // default name when translating from value to name
enm_default_value, // default value when translating from name to value
enm_ignore, // ignore value or name
@@ -260,9 +266,9 @@ public:
sInt16 numValues;
// conversion specification(s) for each value
TConversionDef *convdefs;
- // if set, property is not processed but stored entirely (unfolded, but otherwise unprocessed) in the first <value> defined
- // This gets automatically set when a property name contains an asterisk wildcard character
- bool unprocessed;
+ // if set, property is not processed but stored entirely (unfolded, but otherwise unprocessed) in the first <value> defined
+ // This gets automatically set when a property name contains an asterisk wildcard character
+ bool unprocessed;
// if set, property has a list of values that are stored in an array field or
// by offseting fid. Note that a PropNameExtension is needed to allow storing more
// than a single value. If valuelist=true, convdefs should only contain a single entry,
@@ -349,7 +355,7 @@ public:
bool aCanFilter=false, // can be filtered -> show in filter cap
TMimeDirMode aModeDep=numMimeModes, // property valid only for specific MIME mode
char aAltValuesep=0, // no alternate separator
- sInt16 aGroupFieldID=FID_NOT_SUPPORTED, // no group field
+ sInt16 aGroupFieldID=FID_NOT_SUPPORTED, // no group field
bool aAllowFoldAtSep=false // do not fold at separators when it would insert extra spaces
);
void usePropertiesOf(TProfileDefinition *aProfile);
@@ -358,7 +364,7 @@ public:
TProfileDefinition *findProfile(const char *aNam);
// next in chain
TProfileDefinition *next;
- // parent profile
+ // parent profile
TProfileDefinition *parentProfile; // NULL if root
// Profile Level name
TCFG_STRING levelName;
@@ -412,8 +418,8 @@ public:
virtual void localResolve(bool aLastPass);
protected:
virtual void nestedElementEnd(void);
- // - check conversion mode
- virtual bool getConvMode(const char *aText, sInt16 &aConvMode);
+ // parse conversion mode
+ bool getConvMode(cAppCharP aText, sInt16 &aConvMode);
#endif
virtual void clear();
private:
@@ -424,12 +430,12 @@ private:
bool processPosition(TParameterDefinition *aParamP, const char **aAttributes);
// parsing vars
TProfileDefinition *fOpenProfile; // profile being parsed
- TPropertyDefinition *fOpenProperty; // property being parsed
- TParameterDefinition *fOpenParameter; // parameter being parsed
- TConversionDef *fOpenConvDef; // conversion definition being parsed
- TPropertyDefinition *fLastProperty; // last property added in profile (to build groups)
- uInt16 fPropertyGroupID; // property grouping
- #endif
+ TPropertyDefinition *fOpenProperty; // property being parsed
+ TParameterDefinition *fOpenParameter; // parameter being parsed
+ TConversionDef *fOpenConvDef; // conversion definition being parsed
+ TPropertyDefinition *fLastProperty; // last property added in profile (to build groups)
+ uInt16 fPropertyGroupID; // property grouping
+ #endif
}; // TMIMEProfileConfig
@@ -477,9 +483,9 @@ public:
// set profile options
// - mode (for those profiles that have more than one, like MIME-DIR's old/standard)
virtual void setProfileMode(sInt32 aMode);
- #ifndef NO_REMOTE_RULES
+ #ifndef NO_REMOTE_RULES
virtual void setRemoteRule(const string &aRemoteRuleName);
- #endif
+ #endif
// generate Text Data (includes header and footer)
virtual void generateText(TMultiFieldItem &aItem, string &aString);
// parse Data item (includes header and footer)
@@ -517,7 +523,7 @@ private:
#ifndef NO_REMOTE_RULES
// - dependency on certain remote rule(s)
TRemoteRulesList fActiveRemoteRules; // list of active remote rules that might influence behaviour
- bool isActiveRule(TRemoteRuleConfig *aRuleP); // check if given rule is among the active ones
+ bool isActiveRule(TRemoteRuleConfig *aRuleP); // check if given rule is among the active ones
#endif
// vars
TMIMEProfileConfig *fProfileCfgP; // the MIME-DIR profile config element
@@ -568,11 +574,11 @@ protected:
private:
// helpers for CTCap/FilterCap
// - set field options (enabled, maxsize, maxoccur, notruncate) of fields related to aPropP property in profiles recursively
- // or (if aPropP is NULL), enable fields of all mandatory properties
+ // or (if aPropP is NULL), enable fields of all mandatory properties
void setfieldoptions(
const SmlDevInfCTDataPtr_t aPropP, // property to enable fields for, NULL if all mandatory properties should be enabled
const TProfileDefinition *aProfileP,
- TMimeDirItemType *aItemTypeP
+ TMimeDirItemType *aItemTypeP
);
// - set level
bool setLevelOptions(const char *aLevelName, bool aEnable, TMimeDirItemType *aItemTypeP);
@@ -595,15 +601,15 @@ private:
string &aString, // where value is ADDED
char aSeparator,
TMimeDirMode aMimeMode, // MIME mode (older or newer vXXX format compatibility)
- bool aParamValue, // set if generating parameter value (different escaping rules, i.e. ";" and ":" must be escaped)
+ bool aParamValue, // set if generating parameter value (different escaping rules, i.e. ";" and ":" must be escaped)
bool aStructured, // set if value consists of multiple values (needs ";" escaping)
- bool aCommaEscape, // set if "," content escaping is needed (for values in valuelists like TYPE=TEL,WORK etc.)
+ bool aCommaEscape, // set if "," content escaping is needed (for values in valuelists like TYPE=TEL,WORK etc.)
TEncodingTypes &aEncoding, // modified if special value encoding is required
bool &aNonASCII, // set if any non standard 7bit ASCII-char is contained
char aFirstChar, // will be appended before value if there is any value
- sInt32 &aNumNonSpcs, // how many non-spaces are already in the value
- bool aFoldAtSeparator, // if true, even in mimo_old folding may appear at value separators (adding an extra space - which is ok for EXDATE and similar)
- bool aEscapeOnlyLF // if true, only linefeeds are escaped as \n, but nothing else (not even \ itself)
+ sInt32 &aNumNonSpcs, // how many non-spaces are already in the value
+ bool aFoldAtSeparator, // if true, even in mimo_old folding may appear at value separators (adding an extra space - which is ok for EXDATE and similar)
+ bool aEscapeOnlyLF // if true, only linefeeds are escaped as \n, but nothing else (not even \ itself)
);
// - recursive expansion of properties
void expandProperty(
@@ -635,7 +641,7 @@ private:
sInt16 aBaseOffset,
sInt16 aRepOffset,
TPropNameExtension *aPropNameExt, // propname extension for generating musthave param values
- sInt32 &aNumNonSpcs // how many non-spaces are already in the value
+ sInt32 &aNumNonSpcs // how many non-spaces are already in the value
);
// - recursively generate levels
void generateLevels(
@@ -651,11 +657,11 @@ private:
sInt16 aRepOffset, // repeat offset, adds to aBaseOffset for non-array fields, is array index for array fileds
TMultiFieldItem &aItem, // the item where data goes to
bool &aNotEmpty, // is set true (but never set false) if property contained any (non-positional) values
- char aSeparator, // separator between values that consist of a list of enums etc. (more common for params than for values)
+ char aSeparator, // separator between values that consist of a list of enums etc. (more common for params than for values)
TMimeDirMode aMimeMode, // MIME mode (older or newer vXXX format compatibility)
bool aParamValue, // set if parsing parameter value (different escaping rules)
bool aStructured, // set if value consists of multiple values (has semicolon content escaping)
- bool aOnlyDeEscLF // set if de-escaping only for \n -> LF, but all visible char escapes should be left intact
+ bool aOnlyDeEscLF // set if de-escaping only for \n -> LF, but all visible char escapes should be left intact
);
// - parse given property
bool parseProperty(
@@ -665,10 +671,10 @@ private:
sInt16 *aRepArray, // array[repeatID], holding current repetition COUNT for a certain nameExts entry
sInt16 aRepArraySize, // size of array (for security)
TMimeDirMode aMimeMode, // MIME mode (older or newer vXXX format compatibility)
- cAppCharP aGroupName, // property group ("a" in "a.TEL:131723612")
- size_t aGroupNameLen,
- cAppCharP aFullPropName, // entire property name (excluding group) - might be needed in case of wildcard property match
- size_t aFullNameLen
+ cAppCharP aGroupName, // property group ("a" in "a.TEL:131723612")
+ size_t aGroupNameLen,
+ cAppCharP aFullPropName, // entire property name (excluding group) - might be needed in case of wildcard property match
+ size_t aFullNameLen
);
// parse MIME-DIR level from specified string into item
bool parseLevels(
@@ -725,9 +731,9 @@ void MakeAllday(TItemField *aStartFldP, TItemField *aEndFldP, timecontext_t aTim
-} // namespace sysync
+} // namespace sysync
-#endif // MimeDirProfile_H
+#endif // MimeDirProfile_H
// eof
diff --git a/src/sysync/vcalendaritemtype.h b/src/sysync/vcalendaritemtype.h
index b3f5bcf..1c2cc3b 100755
--- a/src/sysync/vcalendaritemtype.h
+++ b/src/sysync/vcalendaritemtype.h
@@ -23,10 +23,6 @@ using namespace sysync;
namespace sysync {
-// define local conversion mode for MIME-derivate
-#define CONVMODE_RRULE CONVMODE_MIME_DERIVATES+0
-
-
// vCalendar variants
typedef enum {
vcalendar_vers_1_0,