April 29, 2024, 10:38:50 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Aurora Common Classes

Started by Zen, January 06, 2006, 11:26:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zen

January 06, 2006, 11:26:04 AM Last Edit: January 26, 2006, 02:13:35 PM by Lewis
Ok now we have a software projects forum i will place all on-goings in here. Hopefully Paul will make this a sticky as it will probably take a while to get this project 100% complete and i would like to keep it on top.

--------------------------------------------- ORIGINAL POST FOLLOWS ---------------------------------------------

A bit later on, once Aurora has settled down a bit and is more stable i plan to make some common classes for use with Aurora.

Here are some ideas i had in mind.

Base Class - Handle errors and such for all classes

Internet:Base

POP3:Internet - For communicating with pop3 servers to recieve mail
SMTP:Internet - For communicating with SMTP server to send e-mail
HTTP:Internet - Use GET and POST commands with http and other common HTTP functions  Almost Done!
NNTP:Internet - Send and recieve Network News
SOAP:Internet - Send and recieve XML format files on the SOAP protocol
Raw:Intrernet - Raw Internet API for making your own servers and clients Done!

Database:Base

MySQL:Database - For communicating directly with MySQL (No MyODBC required) Under Progress
MSSQL:Database - For communicating directly with Microsoft SQL Server (No ODBC)
Access:Database - Maybe added, but i think Paul will be doing this as part of the ODBC library

Dialogs:Base

Find:Dialogs - The common Find dialog you see everywhere
Replace:Dialogs - The Common Find/Replace dialog
About:Dialogs - An about dialog template.

Files:Base

XML:Files - For parsing and creating XML documents  Almost Done!
SQL::Files - For parsing Structured Query Languages

Hash:Base

MD5:Hash - Used to create MD5 Hashes Done!
CRC32 - Used to create CRC32 Hashes

More to be added

Compression:Base

Zip:Compression - Extract and add files to Zip archives (windows and linux)
Gzip:Compression - As used in fletchies Pak gen
Rar:Compression - Another common archive format for windows and linux
Cab:Compression - Yet another common archive, mainly for windows

----------------------------------------------------------------------------------------

Thats all i have thought of at the moment. If anyone else has any ideas for some more common classes then let me know.

Lewis

EDIT: SAOP Protocol was removed as there was no interest and SOAP was added ;)

Zen

Firstly the MD5 hashing class is about 99% complete. Just having some teething problems. The class i am working on at the moment is the Raw internet class.

I would like to get some feedback for class method names and how people like to use it. As this is will be something i hope you will all use, you should get your say.

Lewis

Parker

I was wondering when I'd see this come up again ;)

I have stack, queue, linked list, dictionary, and I can make a btree one.

Also to be included in here I hope is a function that I will write, not to be part of a class, but called GetAuroraDir() that works like fletchie's GetIBProDir() and retrieves the path of the Aurora compiler on the user's system. But it uses the windows registry, so I will have to figure out how to make it work on Linux.

I'd also recommend the SHA algorithm(s) included in the crypto part.

For class specifics, usually they are prefixed with a C (at least in MFC convention), for example, CCrypto, CInetBase, CDataBase, CCommonDialogs, CFileParser, CCompression -- just what I might name them, for examples.
Methods are named appropriately, for example CCrypto::MD5(), CFileParser::LoadXMLDoc(), CDataBase::MySQLConnect(), ect. But member variables usually have a convention. m_hFile refers that you have a member variable ( m_ ), that is is a HANDLE to something ( h ) and the name ( File ).

For files, it wouldn't be a bad idea to have one that wraps the file functions for those who prefer to use OOP.

When/if we have operator overloading, I'll write a dynamic string class (and possibly dynamic arrays, but that kind of requires templates) so you don't have to worry about overwriting memory and pointers.

A CScintilla control wrapper would be nice, I can do that unless Paul was planning on it.

By the way, I like the SAOP protocol way more than SOAP ;) -- see first message

Zen

Yes i invented SAOP, all my myself. lol. Ill change that especialy for you Parker.

Well at the moment this will be for windows only. Once the linux version of the compiler is up and running and i re-install linux again i will add the linux part, hopefully keeping as much syntax the same as possible. Or perhaps re-make it all again for linux and just prefix the class includes with either w_ or l_ depending on the system you want it for.

As regards to cryptography i will be adding a fair few others too.

I also have a little suprise class that i will leave for you to ponder upon and i will reveal it when its ready. Muha ha ha

Keep the ideas coming a long people.

Lewis

Parker

Usually you compile the libraries separately for windows and linux, since the windows one would crash a linux app anyways, and vice versa. For example the Aurora libraries will only differ in Paul's code, we will use the same code.

Zen

Ok i will be posting the very first part of the common classes. At the moment there will be just the RAW internet class for creating your own servers / clients. You can also use it for connecting to ports and sending and recieving data manualy.

I do not yet have an example but i will post one when i get time. I will be posting this within the next day or so. If people can test it and let me know if they find any bugs that would be great.

Lewis

Zen

So far the Raw internet class consits of the following...


class Raw {

/* Class Methods */

declare Raw(); /* Constructor */
declare _Raw(); /* Deconstructor */

declare Connect(string address,unsigned word port),int; /* Connect To A Server */
declare Disconnect(); /* Disconnect An Active Connection */

declare StartServer(unsigned word port),int; /* Start Listening */
declare StopServer(); /* Stop Listening */
declare Accept(); /* Accept A Connection */
declare Listen(); /* Listen For New Connections */

declare Send(string strdata),int; /* Send Data */
declare Recieve(int bufferLen),int; /* Recieve Data */

declare GetClientIP(); /* Get Client IP */

declare virtual onRecieve(string data,int Bytes); /* Called When Data Is Recieved */
declare virtual onSend(string strData,int Bytes); /* Called When Data Is Sent */
declare virtual onConnect(); /* Called When A Client Is Connecting But Not Yet Accepted */

}


Just incase anyone wants a sneak peak at the functions.

Lewis

Zen

Ok the first class is all ready to go, for testing. There have been tow more functions added to the list in my previous post (ServerSend and ServerRecieve) that speak for themselves. The GetClientIP function is not yet working also.

As soon as i make a nice GUI example of the class in action instead of the nasty console app i have been using to test it i will post the first version here.

Lewis

Parker

This means I can make a simple server? That's good. I know nothing of internet programming :)

Lewis, it's only you and me posting in this topic. For anyone else, is there interest in these classes? It should be somewhat like the ctl pak from Fletchie when it's done.

Zen

Well thats the idea but like you said, only me and you. Well the good thing about the raw internet class will enable you do what you want with it. I made a simple chat program before in IBasic with this. But back then i used a third party library to do it. This one uses the windows API so i have learnt a bit more whilst making and testing it.

Lewis

Zen

I will be posting tomorrow now as i have not finished the example because i forgot to code in the timeout. So once i started the server the GUI locked up and you couldnt do anything else.

So i know you are all (parker, maybe) excited but you will just have to wait.

Lewis

Steven Picard

Yes, I am interested in this class.  I've been under the gun at work lately so I've been more of a spectator on the forums than anything.  Hopefully, that will change soon when my latest project is done.  But without a doubt, I am very interested in it.

LarryMc

Lewis,
I'm always interested in what you and Parker say/post; especially code! ;D
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Zen

Fantastic. Well even if i just made it for myself to use then i would be happy, because is would work and i would know that i have learnt something new. Hopefully as time goes along i will add more and more classes for people to use and make Aurora easier.

Glad there is interest afterall.

Lewis

Parker

The only way to stop the GUI from freezing up is to use threads. You can do it with the windows API for now, but I'll be writing a thread class pretty soon for inclusion with this library.

Bruce Peaslee

Quote from: tlmccaughn on January 10, 2006, 03:02:16 PM
Lewis,
I'm always interested in what you and Parker say/post; especially code! ;D
I won't take that personally (sob...).
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

poor baby... didn't mean to leave you out :D

Somtimes what you post is so far over my head it reminds me of the old Brother Dave Garner joke.

"Heck, that's so easy I'll let my chaufer answer it"
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Zen

Actually i can do it without it freezing. I did it in IBasic Pro. Its just the Accept command i forgot to put the timeout in, so it will not return unless someone connects. Its should timeout after 5 seconds or so and then restart so that it is always listening for connections but also leaves time for the user to interface.

Lewis

Parker

Oh, okay then. Well, if you want to use threads... they're good for you ::)

Zen

Thanks. A Thread class would be good though.

Lewis

Parker

I'm thinking about how to implement it though, since a thread usually stands as its own subroutine. I could either have one method that you should override, or I could just wrap the threading functions and make a start thread function. I'll think about it.

Zen

January 12, 2006, 12:08:14 PM #21 Last Edit: January 12, 2006, 03:31:18 PM by Lewis
Right i know i am meant to be off sick but i just thought i would fix the minor problem with the raw network class. So i still dont have a demo yet so you will just have to have a play around with it or wait untill i get back.

So here we go, Alpha 1.

Lewis

EDIT: File removed, check latest post for updated version

Rod

Lewis and Parker:

Sorry I've let this go on so long without letting you know how interested I am in what you're doing and how much I APPRECIATE your efforts. I've been too much of a sidelines viewer so far ... I'm still trying to get up to speed on that other language, and don't do so well learning a new one without the documentation. Perhaps, however, I can contribute a class or two. Anything I do along that line, I'll coordinate efforts with you.

Parker

January 12, 2006, 03:16:10 PM #23 Last Edit: January 12, 2006, 04:47:21 PM by Parker
I've got a few classes I'm almost ready to contribute, and the GetAuroraDir function, and two I'm writing: ArgC() and ArgV().

The list that will be written by me currently includes
- Linked list
- Queue
- Stack
- Dictionary (an alternative for Paul's)
- Binary Tree
- Threading
- Windows Service
- Registry (feel free to take this away from me though)
- The functions GetAuroraDir(), ArgC(), and ArgV().

Zen

For the other functions parker, how about just put them in a class called tools or misc?

Lewis