[Gambas-devel] [RFC] Gambas implementation of the pop3 protocol

Fabien Bodard gambas.fr at ...176...
Sun Aug 26 23:36:23 CEST 2012


2012/8/26 Fabien Bodard <gambas.fr at ...176...>:
> why
> stripOK
> IsPositive
> IsNegative are STATIC PUBLIC and not simply PRIVATE ?

stat must be private too... i think

YOu must to hide the functions retrieve too has you use _get for that
and the function in the children class.

so pop3 must just have

IN PUBLIC
connect
disconnect
delete
reset
count
close
size    is the size of all messages
_get

The message classe :

Top(lines as integer)
Text
UniqID
Size



so please re read Benoit 's mail about interface ...

- The number of messages to read. (STAT)
- The size of all theses messages. (STAT)
- The size of one message. (LIST x)
- One specific message. (RETR x)
- Delete one message. (DELE x)
- Undelete all messages. (RSET)
- The beginning of a message. (TOP x n)

All that could be done with well-named method, the _get special method...

- The number of messages to read. -> .Count
- The size of all theses messages. -> .Size
- The size of one message. -> [x].Size
- One specific message. -> [x].Text
- Delete one message. -> [x].Delete()
- Undelete all messages. -> .Reset()
- The beginning of a message. -> [x].Summary ? OR .ShortText

if you want you can use that trick too

in__get

dim hPopMessage as New _PopMessage as "Message"

return  hPopMessage

end



in the popmessage class you can the se the current instance of
pop3Client as you need to be able to manage multiple instance

for example in the text proc

Private Function Text_Read() As String

  dim hPopClient as pop3client = Object.Parent(me)
  Return hpopClient._Retrieve($msgid)

End


you need to use only local declaration for that to not have freeing
problem then.

so this line :
dim hPopClient as pop3client = Object.Parent(me)

need to be in all the sub of _popmessage to get the instance that own
the message child.

i don't know if all of that can help you ...




-- 
Fabien Bodard




More information about the Devel mailing list