http://bugs.openzim.org/show_bug.cgi?id=15





--- Comment #1 from Tommi Mäkitalo <[email protected]>  2009-12-23 16:11:11 CET 
---
It does not really return a binary value but a struct, which has a ostream
operator. If you want to have a ascii encoded std::string, you may want to use
a std::ostringstream:

  std::ostringstream m;
  m << file.getFileheader().getUuid();
  std::string myHexEncodedUuid = m.str();

If it is still needed to provide a std::string directly, I may add a small
helper like toString, which does exactly this.

If you just want to print it to std::cout, you can do:

  std::cout << file.getFileheader().getUuid();

The reason, why I did it that way is, that it is more versatile and efficient
to do it that way. You should think, why or better if you really need a
std::string. If I add a method toString you may do:

  std::cout << file.getFileheader().getUuid().toString();

This is more verbose but less efficient, since you allocate a temporary string,
which is thrown away. I do not see a real advantage.

-- 
Configure bugmail: http://bugs.openzim.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
dev-l mailing list
[email protected]
https://intern.openzim.org/mailman/listinfo/dev-l

Reply via email to