uuid_key.cc
Go to the documentation of this file.
00001 /* 00002 * Copyright 2010 Savarese Software Research Corporation 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * https://www.savarese.com/software/ApacheLicense-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #include <ssrc/wispers/utility/uuid_key.h> 00018 //#include <ssrc/wispers/utility/UUIDGenerator.h> 00019 00020 #include <ostream> 00021 #include <cstdio> 00022 00023 __BEGIN_NS_SSRC_WSPR 00024 00025 std::ostream & operator<<(std::ostream & out, const uuid_key_type & uuid_key) { 00026 // We do it this way because the commented out section isn't zero-padding 00027 // the low bits. 00028 char buf[65]; 00029 ::snprintf(buf, sizeof(buf), "%0.16llx%0.16llx", 00030 uuid_key.high_bits, uuid_key.low_bits); 00031 return (out << buf); 00032 /* 00033 std::ostream::fmtflags flags = out.flags(); 00034 std::streamsize width = out.width(boost::uuids::uuid::static_size()); 00035 std::ostream::char_type fill = out.fill('0'); 00036 00037 out.setf(std::ios::hex, std::ios::basefield); 00038 out.setf(std::ios::right, std::ios::adjustfield); 00039 00040 out << uuid_key.high_bits << uuid_key.low_bits; 00041 00042 out.fill(fill); 00043 out.width(width); 00044 out.flags(flags); 00045 return out; 00046 */ 00047 } 00048 00049 __END_NS_SSRC_WSPR
Copyright © 2006-2011 Savarese Software Research Corporation. All rights reserved.