No, I am not ignoring errors or warnings. I just don't get those in MS VS 2008. If you see errors, please, by all means point them out. I just updated the code to include all classes inside a namespace and define some shortcuts.
As usual, I get a bunch of errors from the online compiler that MS VS2008 do not. Feel free to critique further.
Hello ne555. Thanks for dropping by. Glad you like the project.
I know what you mean:
1 2 3 4 5 6 7 8 9 10
class LengthUnit : public Unit
{
...
public:
staticconst LengthUnit Foot;
staticconst LengthUnit Meter;
};
const LengthUnit LengthUnit::Foot("foot", "ft", 0.3048, false);
const LengthUnit LengthUnit::Meter("meter", "m", 1.0, true);
The answer is: It could be. Right now, I am not 100% if I need entire classes to differentiate. I did this "just in case", just as I did LengthUnit, TimeUnit, etc. Maybe the class tree can be reduced.
Now I know LengthUnit, TimeUnit, etc. were good choices because objects of type Length, Time, etc. can reject units that are not of the correct dimensions (correct base unit type).
EDIT: So sorry I left one of your questions hanging: LPTSTR is char * if _UNICODE is not defined, and it is wchar_t* if _UNICODE is defined. It fits the scheme used by the Windows SDK, and actually it is exactly what the Windows SDK does.
FYI, I won't be online for two days. Back on Sunday or Monday.
Feel free to point out the many errors you encounter, especially those that I don't catch/know because I'm such a Windows groupie, hehe. This should compile for any OS, so your help in this regard is much appreciated.
The idea about using LengthUnit as an object is kind of close to what I suggested from the beginning (different thread). If it comes to a vote that's the way I would want to go. But either way I'm too interested in this idea to abandon it because a tiny difference in opinion like that.
Does this library just convert between SI units and things like this, or does/will it have classes to e.g. calculate quantities like force and velocity, do vector math, that kind of thing?
If so, I'd be very interested in helping with that sort of thing. I've written a Euclidean vector class already, I can post it if you'd like. It depends on a vertex class I wrote as well.
@ chrisname: We'll get there, but the goal is to be able to process those calculations regardless of input. In order to do this we need to be able to move seemlessly between Imperial units and Metric.
Hello everyone. I decided to stick with CodePlex. My apologies if this is disappointing for anyone. I like 2 things there: 1. No extra username as I can log in using my Live ID; 2. I can use SVN.
I have no cool name for this yet, so for now it is called "Dimensional Values" and is not yet published. Since the coding so far has been small (more class definitions than anything else), I decided it would be nice to see how it behaves as a static library. I guess we can later change the project type or even maybe have both? If MFC and ATL can be both, why can't we, right?
I'll continue moving some code around and then I'll publish. If you guys (willing to participate) have Live ID's, I guess I'll need them to give you access to the projects. PM me those so they are kept private.