(Copied from the PTypes home page)

PTypes (C++ Portable Types Library) is a simple alternative to the STL that includes multithreading and networking. It defines dynamic strings, variants, character sets, lists and other basic data types along with portable thread and synchronization objects, IP sockets and named pipes. Its main `target audience' is developers of complex network daemons, robots or non-visual client/server applications of any kind.

I did NOT write the original PTypes - all that hard work was done by Hovik Melikyan.

PTypes was last updated 27-Jun-2007 and between now and then boost has made it's way into not only most people's applications but also the C++ standard - I still believe something like PTypes is still useful today. Boost does offer most if not all the functionality of PTypes, but at a cost - it introduces code bloat. Also boost does have a small learning curve, which in comparison personally I find PTypes to have little to no learning curve.

So, this fork of PTypes is to breathe new life into the library.

My first big contributions are a json library and a new type called (p)tparray (aka ptypes parallel array). I also added an add function for variants - which is simply a one line of: put(v, alength(v), var);

This allows you to use the bracket addressing to get at values vs using functions.

JSON most people should know so there isn't really anything mystical to explain here, however, tparray is a simple parallel that can be either a list/vector/dynamic array-type (ie [1,2,3]) or an associative array/dictonary type (ie {"test":1234}). This was required due to a design in the way variants store keys for arrays. Even though a variant can store a numberic key - it gets converted to a string. When working with JSON I needed to know if the original value was a string or a number.

Here is a small to-do list:

  • [ ] Get the tests working on Windows*
  • [ ] Make it easier to use tparrays**
  • [ ] Add stream operators -
  • [ ] Add optional SSL code that leverages OpenSSL*** -

* For some reason VS2010 (and probably up) chokes on on test about unresolved externals for tpodlist. I've spent several hours on this and came up with nothing. It does compile on Linux strangly enough.

** Such as implement accessing/setting elements using bracket operators

*** SSL will be optional via macro defines that you can turn on/off

Featured Documentation
show more...

Development Team
Natalie Adams


Powered by InDefero,
a CĂ©ondo Ltd initiative. is ran by
Nathan Adams.
Page rendered in 0.03682s using 45 queries.