bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Questions


From: David Durham
Subject: Questions
Date: Mon, 28 Jan 2002 14:50:14 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011221

Hi, I just found this library today in search of something like it and was pleasently surprised. Because I want to release some source code soon, I've recently been trying to move away from my little libraries that I've used for years to more standard stuff. I've converted one of my projects to the STL now that it is defined and comes sufficiently well implemented on gcc and other compilers. I was wondering if CommonC++ uses the STL whereever possible. I don't guess much of it requires a whole lot of container-like use, perhaps the persistance stuff. I could find any classes that dealt with time... maybe I missed it... I saw dates, but no date/time class. I have one if necessary.

Also, I have a class that is a readers/writers mutex which is simply wrapped around 2 other mutexes, so it would be simple to merge into CommonC++. Basically, it allows 1 write lock but multiple simultaneous read locks. Is there another way of doing that already in CommonC++?

I also have an idea for a Path class which would have functionality that, constructed from a string, would have methods of getting the directory or the filename from it. The implementation isn't as trivial as finding the last '/', because you have to correctly handle '.' as the entire path. glibc does have pathname and dirname, but they comform to the SUSv2 standard, so are not guarenteed to be on all systems. I suppose you could imagine other things you could use a Path class for, perhaps breaking the path up into all the directories components, making sure paths exist, touching files, etc... If this sounds like a worthy class to implement for CommonC++, I'd be glad to write it. Currently, I have an .h file which has dirname, basename and touch functions, but again, I'm trying to move as much as possible away from these little implementations which aren't even autoconfiscated.

Lastly, I have a couple of template classes which are used to create temporary buffers of memory or temporary arrays of object which get deallocted when the variable goes out of scope. I know you'd think that auto_ptr in the STL can be used for this, but it can only (as far as I can tell) be used for a single object, and not an array of objects. Plus, my template class can auto cast to a pointer of the type it is instantiated for, or a void * and can be subscripted all of which auto_ptr doesn't do.
-- Davy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]