New C++ library project
I’ve decided that I’m starting a new c++ library project instead of a 2nd version of AXCEL. It’s called CodeTherapy and is hosted at github:
It’s currently undergoing development. But you can watch my progress as I upload and modify source files to the repo.
The stream classes will be redesigned. Instead of having pure virtual functions in the stream classes, they will be virtual functions with a default behavior of failing and setting the last error associated with the object to ENOTSUP (Not supported). Derived classes of stream will have to at least implement getc or putc member functions while functions like seek, tell, flush, peek, and sync will be optional to implement. The programmer then can override readable, writable, seekable, buffered, and peekable boolean functions which specify which set of optional functions are supported.
The string and bytes classes will be integrated with the STL.
My goal is to have the library handle code like this:
stream s = fopen("foo.txt", "w"); s.puts("hello world!"); s.close(); ... lnstream s = tcp::connect("www.google.com", "80"); s << "GET " << resource << " HTTP/1.1\r\nHost: www.google.com\r\n\r\n"; string header = s.drink("\r\n\r\n"); ... s.close();