[csmaild-cvs] csmaild/src/Imap/Commands ImapCommand.cs,1.10,1.11
Brought to you by:
tamc
|
From: <ta...@us...> - 2003-08-01 22:02:40
|
Update of /cvsroot/csmaild/csmaild/src/Imap/Commands
In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src/Imap/Commands
Modified Files:
ImapCommand.cs
Log Message:
Updated 1.0 project files to include new stuff
Added blank SMTP project
Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;))
Can now add messages to the messagecollection
The enumerator for messagecollection works properly now
Added method to mailstore provider to allow for accessing the raw message via a reader
Added ability to have optional arguments on IMAP commands
Fixed literal string parsing
External accessors to the sequence range
Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection)
Index: ImapCommand.cs
===================================================================
RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/ImapCommand.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ImapCommand.cs 30 Jul 2003 22:37:56 -0000 1.10
--- ImapCommand.cs 1 Aug 2003 22:02:37 -0000 1.11
***************
*** 111,115 ****
#region Global argument stuff
! [Flags()] protected enum ArgumentType
{
CustomHandler = 0,
--- 111,115 ----
#region Global argument stuff
! protected enum ArgumentType
{
CustomHandler = 0,
***************
*** 124,127 ****
--- 124,130 ----
ParenthesizedList = 64,
ParenthesizedListAtom = 66, // paren(64) + atom(2)
+ Optional = 128,
+ OptionalParenthesizedList = 192,
+ OptionalQuotedString = 129
}
***************
*** 130,140 ****
for(int idx = 0; idx < mArgumentTypes.Length; ++idx)
{
! if(mUnparsedArgumentIdx >= mUnparsedArguments.Length)
! return false;
! else if(mUnparsedArguments[mUnparsedArgumentIdx++] != ' ')
! return false;
! object arg = ParseArgument(mArgumentTypes[idx]);
! if(arg == null)
! return false;
mParsedArguments[idx] = arg;
}
--- 133,158 ----
for(int idx = 0; idx < mArgumentTypes.Length; ++idx)
{
! object arg = null;
! if((mArgumentTypes[idx] & ArgumentType.Optional) == ArgumentType.Optional)
! {
! if(mUnparsedArgumentIdx < mUnparsedArguments.Length)
! {
! if(mUnparsedArguments[mUnparsedArgumentIdx++] != ' ')
! return false;
! arg = ParseArgument(mArgumentTypes[idx]);
! if(arg == null)
! --mUnparsedArgumentIdx; // move back to the space
! }
! }
! else
! {
! if(mUnparsedArgumentIdx >= mUnparsedArguments.Length)
! return false;
! else if(mUnparsedArguments[mUnparsedArgumentIdx++] != ' ')
! return false;
! arg = ParseArgument(mArgumentTypes[idx]);
! if(arg == null)
! return false;
! }
mParsedArguments[idx] = arg;
}
***************
*** 201,206 ****
string literalString = mConnection.ReadBlockAsString((int)literalSize);
! // make sure it's a valid literal string (any ascii character besides \0
! if(!Regex.IsMatch(literalString, @"^[\x01-\xFF]$"))
return null;
--- 219,224 ----
string literalString = mConnection.ReadBlockAsString((int)literalSize);
! // make sure it's a valid literal string (any ascii character besides \0)
! if(!Regex.IsMatch(literalString, @"^[\x01-\xFF]*$"))
return null;
***************
*** 315,318 ****
--- 333,352 ----
private SequenceRange mNext;
+ public SequenceRange NextRange
+ {
+ get
+ {
+ return mNext;
+ }
+ }
+
+ public SequenceRange PreviousRange
+ {
+ get
+ {
+ return mPrevious;
+ }
+ }
+
public uint Low
{
***************
*** 413,416 ****
--- 447,458 ----
private SequenceRange mRootNode;
+
+ public SequenceRange FirstRange
+ {
+ get
+ {
+ return mRootNode;
+ }
+ }
public void AddRange(uint num)
|