uuid_str.C 954 Bytes
Newer Older
Francois Gygi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// uuid_str.C
//
////////////////////////////////////////////////////////////////////////////////

19
#if USE_UUID
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#include <uuid/uuid.h>
#include "uuid_str.h"
using namespace std;

std::string uuid_str(void)
{
  unsigned char uuid_c[16];
  char s[36];

  // generate uuid
  uuid_generate_time(uuid_c);

  // convert to string
  uuid_unparse(uuid_c,s);

  return string(s);
}
37
#endif