robotology/yarp — pull request #45 by paulfitz (2013-06-27 20:08:41+00:00)
Title: yarp::os::ConstString, yarp::os::impl::String -> std::string

A big obstacle to cleaning up YARP's innards is lack of a decent string class. The `yarp::os::impl::String` class depends on ACE, and `yarp::os::ConstString` has a private implementation (leading to lots of unnecessary copies).

YARP avoids `std::*` classes for reasons that are now ancient history. This PR typedefs `yarp::os::ConstString` and `yarp::os::impl::String` to be `std::string`, and makes such modifications to the API as are needed to keep most user code running unchanged.

User code that depends on `yarp::os::ConstString` being automatically castable to `const char *` will no longer work. Solution for user is to add `.c_str()`. Compiler error messages should be clear, even if user isn't aware of what has changed or why.

Follow-up work would be to replace usage of these classes rather than just typedef them, but at this point that would result in excessive patch noise, making any problems that crop up harder to track down.

This change will simplify clean-up of classes in `yarp::os::impl` including those related to carriers.