HomePhabricator

Allow to construct CMIUtilString using std::string directly + cleanup…

Description

Allow to construct CMIUtilString using std::string directly + cleanup CMIUtilString (MI)

Summary:
Allow to construct CMIUtilString using std::string directly + cleanup CMIUtilString (MI)

This patch cleans up lldb-mi code, and serves to simplify
the following case:

std::string strGoodbye = "!Hello";
CMIUtilString strHello(strGoodbye.substr(1).c_str());

With CMIUtilString(std::string) we can omit .c_str():

std::string strGoodbye = "!Hello";
CMIUtilString strHello(strGoodbye.substr(1));

Also, it removes 2 ctors because they aren't needed:

  1. CMIUtilString::CMIUtilString(const char *const *vpData)
  2. CMIUtilString::CMIUtilString(const char *vpData, size_t nLen)

and cleans up CMIUtilString::operator=(const std::string &vrRhs).

Reviewers: brucem, abidh

Subscribers: lldb-commits, brucem, abidh

Differential Revision: http://reviews.llvm.org/D13158