• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Uuid类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Uuid的典型用法代码示例。如果您正苦于以下问题:C++ Uuid类的具体用法?C++ Uuid怎么用?C++ Uuid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Uuid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UTEXT

   IContent* ContentManager::load(const String& name)
   {
      IContent* presult = NULL;

      String path = name + UTEXT(".c2d");
      path.toLower();

      File* pfile = FileSystem::getInstance().open(path, File::ERead | File::EBinary);
      if ( pfile != NULL )
      {
         Uuid uuid;
         FileReaderStream stream(*pfile);
         uuid.read(stream);

         ContentModule* pmodule = findModule(uuid);
         if ( pmodule != NULL )
         {
            ContentReader& reader = pmodule->getReader();
            reader.setContentManager(*this);
            reader.setGraphicsDevice(mpDevice);
            reader.setPhysicsSimulator(mpSimulator);
            reader.setSoundManager(mpSoundManager);

            presult = reader.read(stream);
            if ( presult != NULL )
            {
               presult->setFilename(name);
            }
         }
      }

      return presult;
   }
开发者ID:crafter2d,项目名称:crafter2d,代码行数:33,代码来源:contentmanager.cpp


示例2: SI_Base

SI_SymbolPin::SI_SymbolPin(SI_Symbol& symbol, const Uuid& pinUuid) :
    SI_Base(), mCircuit(symbol.getSchematic().getProject().getCircuit()),
    mSymbol(symbol), mSymbolPin(nullptr), mComponentSignal(nullptr),
    mPinSignalMapItem(nullptr), mComponentSignalInstance(nullptr),
    mAddedToSchematic(false), mRegisteredNetPoint(nullptr), mGraphicsItem(nullptr)
{
    // read attributes
    mSymbolPin = mSymbol.getLibSymbol().getPinByUuid(pinUuid);
    if (!mSymbolPin)
    {
        throw RuntimeError(__FILE__, __LINE__, pinUuid.toStr(),
            QString(tr("Invalid symbol pin UUID: \"%1\"")).arg(pinUuid.toStr()));
    }
    mPinSignalMapItem = mSymbol.getCompSymbVarItem().getPinSignalMapItemOfPin(pinUuid);
    if (!mPinSignalMapItem)
    {
        throw RuntimeError(__FILE__, __LINE__, QString(),
            QString(tr("Pin \"%1\" not found in pin-signal-map of symbol instance \"%2\"."))
            .arg(pinUuid.toStr(), symbol.getUuid().toStr()));
    }
    Uuid cmpSignalUuid = mPinSignalMapItem->getSignalUuid();
    mComponentSignalInstance = mSymbol.getComponentInstance().getSignalInstance(cmpSignalUuid);
    mComponentSignal = mSymbol.getComponentInstance().getLibComponent().getSignalByUuid(cmpSignalUuid);

    mGraphicsItem = new SGI_SymbolPin(*this);
    updatePosition();

    // create ERC messages
    mErcMsgUnconnectedRequiredPin.reset(new ErcMsg(mCircuit.getProject(), *this,
        QString("%1/%2").arg(mSymbol.getUuid().toStr()).arg(mSymbolPin->getUuid().toStr()),
        "UnconnectedRequiredPin", ErcMsg::ErcMsgType_t::SchematicError));
    updateErcMessages();
}
开发者ID:0xB767B,项目名称:LibrePCB,代码行数:33,代码来源:si_symbolpin.cpp


示例3: test_uuid

static void test_uuid(Config & conf)
{
    Uuid guid;
    guid.generate();

    std::cout << guid.to_string() << std::endl;
}
开发者ID:huangyt,项目名称:MyProjects,代码行数:7,代码来源:Uuid.cpp


示例4: TEST

TEST(UuidTest, Clear)
{
    Uuid uuid = Uuid::GenerateUuid();
    EXPECT_FALSE(uuid.IsNull());

    uuid.Clear();
    EXPECT_TRUE(uuid.IsNull());
}
开发者ID:gzhu108,项目名称:sg,代码行数:8,代码来源:UuidTest.cpp


示例5: setCurrentProgram

void CtrlrMIDILibrary::setCurrentProgram(const Uuid &uuid, const MidiProgramChangeControl midiProgramChangeControl, const bool changePanelState, const bool setAsCurrentProgram)
{
	ValueTree program = getCurrentBank().getChildWithProperty(Ids::uuid, uuid.toString());

    if (isProgram(program))
		setCurrentProgram (program, midiProgramChangeControl, changePanelState, setAsCurrentProgram);
	else
		_WRN("CtrlrMIDILibrary::setCurrentProgram no program with UUID="+uuid.toString());
}
开发者ID:gareth8118,项目名称:ctrlr,代码行数:9,代码来源:CtrlrMIDILibrary.cpp


示例6: setCurrentSnapshot

void CtrlrMIDILibrary::setCurrentSnapshot(const Uuid &uuid, const MidiProgramChangeControl midiProgramChangeControl)
{
    ValueTree snap = getSnapshots().getChildWithProperty(Ids::uuid, uuid.toString());

    if (isProgram(snap))
		setCurrentSnapshot (snap,midiProgramChangeControl);
	else
		_WRN("CtrlrMIDILibrary::setCurrentSnapshot no snapshot with UUID="+uuid.toString());
}
开发者ID:gareth8118,项目名称:ctrlr,代码行数:9,代码来源:CtrlrMIDILibrary.cpp


示例7: _DBG

void CtrlrMIDILibrary::setCurrentBank(const Uuid &uuid)
{
	_DBG("CtrlrMIDILibrary::setCurrentBank uuid="+uuid.toString());

	if (uuid == getUuid(getRoot()))
	{
		setCurrentBank (getRoot());
		return;
	}

	setCurrentBank (getRoot().getChildWithProperty(Ids::uuid, uuid.toString()));
}
开发者ID:gareth8118,项目名称:ctrlr,代码行数:12,代码来源:CtrlrMIDILibrary.cpp


示例8: to_str

string Store::to_str(const Uuid & uuid)
{
	// 8-4-4-4-12
	stringstream stream;
	convert_to_hex(stream, uuid.most_significant_bits());
	convert_to_hex(stream, uuid.least_significant_bits());
	string result( stream.str() );
	for (int i=0; i<4; i++)
	{
		result.insert(8 + (i * 4) + i, 1, '-');
	}
	return result;
}
开发者ID:carlosvin,项目名称:eventstore,代码行数:13,代码来源:Store.cpp


示例9: checkNewVersion

  void checkNewVersion(const Uuid& uuid, const std::string& extraParams, CheckUpdateDelegate* delegate)
  {
    using namespace base;
    using namespace net;

    std::string url = UPDATE_URL;
    if (!uuid.empty()) {
      url += "&uuid=";
      url += uuid;
    }
    if (!extraParams.empty()) {
      url += "&";
      url += extraParams;
    }

    HttpRequest request(url);
    HttpHeaders headers;
    headers.setHeader("User-Agent", getUserAgent());
    request.setHeaders(headers);

    std::stringstream body;
    HttpResponse response(&body);
    request.send(response);

    CheckUpdateResponse data(body.str());
    delegate->onResponse(data);
  }
开发者ID:DocHoncho,项目名称:aseprite,代码行数:27,代码来源:check_update.cpp


示例10: checkNewVersion

  bool checkNewVersion(const Uuid& uuid, const std::string& extraParams, CheckUpdateDelegate* delegate)
  {
#ifndef UPDATE_URL
#define UPDATE_URL ""
#pragma message("warning: Define UPDATE_URL macro")
#endif

    std::string url = UPDATE_URL;
    if (!uuid.empty()) {
      url += "&uuid=";
      url += uuid;
    }
    if (!extraParams.empty()) {
      url += "&";
      url += extraParams;
    }

    m_request.reset(new net::HttpRequest(url));
    net::HttpHeaders headers;
    headers.setHeader("User-Agent", getUserAgent());
    m_request->setHeaders(headers);

    std::stringstream body;
    net::HttpResponse response(&body);
    if (m_request->send(response)) {
      TRACE("Checking updates: %s (User-Agent: %s)\n", url.c_str(), getUserAgent().c_str());
      TRACE("Response:\n--\n%s--\n", body.str().c_str());

      CheckUpdateResponse data(body.str());
      delegate->onResponse(data);
      return true;
    }
    else
      return false;
  }
开发者ID:Censacrof,项目名称:aseprite,代码行数:35,代码来源:check_update.cpp


示例11: put

void LasHeader::put(OLeStream& out, Uuid uuid)
{
    char buf[uuid.size];

    uuid.pack(buf);
    out.put(buf, uuid.size);
}
开发者ID:,项目名称:,代码行数:7,代码来源:


示例12: checkNewVersion

  void checkNewVersion(const Uuid& uuid, const std::string& extraParams, CheckUpdateDelegate* delegate)
  {
    using namespace base;
    using namespace net;

#ifndef UPDATE_URL
#define UPDATE_URL ""
#endif
#pragma message("warning: Define UPDATE_URL macro")

    std::string url = UPDATE_URL;
    if (!uuid.empty()) {
      url += "&uuid=";
      url += uuid;
    }
    if (!extraParams.empty()) {
      url += "&";
      url += extraParams;
    }

    HttpRequest request(url);
    HttpHeaders headers;
    headers.setHeader("User-Agent", getUserAgent());
    request.setHeaders(headers);

    std::stringstream body;
    HttpResponse response(&body);
    request.send(response);

    TRACE("Checking updates: %s (User-Agent: %s)\n", url.c_str(), getUserAgent().c_str());
    TRACE("Response:\n--\n%s--\n", body.str().c_str());

    CheckUpdateResponse data(body.str());
    delegate->onResponse(data);
  }
开发者ID:Doraenmon,项目名称:aseprite,代码行数:35,代码来源:check_update.cpp


示例13: get

void LasHeader::get(ILeStream& in, Uuid& uuid)
{
    char buf[uuid.size];

    in.get(buf, uuid.size);
    uuid.unpack(buf);
}
开发者ID:,项目名称:,代码行数:7,代码来源:


示例14: throw

ComponentSignalInstance::ComponentSignalInstance(Circuit& circuit, ComponentInstance& cmpInstance,
                                                 const XmlDomElement& domElement) throw (Exception) :
    QObject(nullptr), mCircuit(circuit), mComponentInstance(cmpInstance),
    mComponentSignal(nullptr), mNetSignal(nullptr), mAddedToCircuit(false)
{
    // read attributes
    Uuid compSignalUuid = domElement.getAttribute<Uuid>("comp_signal", true);
    mComponentSignal = mComponentInstance.getLibComponent().getSignalByUuid(compSignalUuid);
    if(!mComponentSignal)
    {
        throw RuntimeError(__FILE__, __LINE__, compSignalUuid.toStr(), QString(
            tr("Invalid component signal UUID: \"%1\"")).arg(compSignalUuid.toStr()));
    }
    Uuid netsignalUuid = domElement.getAttribute<Uuid>("netsignal", false, Uuid());
    if (!netsignalUuid.isNull())
    {
        mNetSignal = mCircuit.getNetSignalByUuid(netsignalUuid);
        if(!mNetSignal)
        {
            throw RuntimeError(__FILE__, __LINE__, netsignalUuid.toStr(),
                QString(tr("Invalid netsignal UUID: \"%1\"")).arg(netsignalUuid.toStr()));
        }
    }

    init();
}
开发者ID:0xB767B,项目名称:LibrePCB,代码行数:26,代码来源:componentsignalinstance.cpp


示例15: setIcon

void Entry::setIcon(const Uuid& uuid)
{
    Q_ASSERT(!uuid.isNull());

    if (m_data.customIcon != uuid) {
        m_data.customIcon = uuid;
        m_data.iconNumber = 0;

        Q_EMIT modified();
        emitDataChanged();
    }
}
开发者ID:Amazeus-Mozart,项目名称:keepassx,代码行数:12,代码来源:Entry.cpp


示例16: addCustomIcon

void Metadata::addCustomIcon(const Uuid& uuid, const QImage& icon)
{
    Q_ASSERT(!uuid.isNull());
    Q_ASSERT(!m_customIcons.contains(uuid));

    m_customIcons.insert(uuid, icon);
    // reset cache in case there is also an icon with that uuid
    m_customIconCacheKeys[uuid] = QPixmapCache::Key();
    m_customIconScaledCacheKeys[uuid] = QPixmapCache::Key();
    m_customIconsOrder.append(uuid);
    Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
    Q_EMIT modified();
}
开发者ID:ThunderPower,项目名称:keepassx,代码行数:13,代码来源:Metadata.cpp


示例17: setIcon

void Group::setIcon(const Uuid& uuid)
{
    Q_ASSERT(!uuid.isNull());

    if (m_data.customIcon != uuid) {
        m_data.customIcon = uuid;
        m_data.iconNumber = 0;

        updateTimeinfo();
        Q_EMIT modified();
        Q_EMIT dataChanged(this);
    }
}
开发者ID:jrodan,项目名称:keepassx,代码行数:13,代码来源:Group.cpp


示例18: videoFormatUuid

bool VideoCaptureDeviceImpl::setCurrentVideoFormat(
    const RGBVideoFormat& videoFormat) {
  if (!isInitialized()) {
    return false;
  }

  if (!videoFormat) {
    return false;
  }

  if (!stopCapturing()) {
    return false;
  }

  const Uuid videoFormatUuid(videoFormat.uuid());
  if (videoFormatUuid.is_nil()) {
    return false;
  }

  VideoFormatConstIterator iterator(
      m_videoFormatsByUuid.find(videoFormatUuid));
  if (iterator == m_videoFormatsByUuid.end()) {
    return false;
  }

  const UuidVideoFormatPair uuidVideoFormatPair(*iterator);
  const VideoFormatSharedPtr pVideoFormat(uuidVideoFormatPair.second);
  if (!pVideoFormat) {
    return false;
  }

  m_currentVideoFormatUuid = uuidVideoFormatPair.first;

  if (!pVideoFormat->setMediaTypeOfStream(m_pStreamConfig)) {
    return false;
  }

  return true;
}
开发者ID:brianfcoleman,项目名称:libvideocapture,代码行数:39,代码来源:VideoCaptureDeviceImpl.cpp


示例19: removeCustomIcon

void Metadata::removeCustomIcon(const Uuid& uuid)
{
    Q_ASSERT(!uuid.isNull());
    Q_ASSERT(m_customIcons.contains(uuid));

    m_customIcons.remove(uuid);
    QPixmapCache::remove(m_customIconCacheKeys.value(uuid));
    m_customIconCacheKeys.remove(uuid);
    QPixmapCache::remove(m_customIconScaledCacheKeys.value(uuid));
    m_customIconScaledCacheKeys.remove(uuid);
    m_customIconsOrder.removeAll(uuid);
    Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
    Q_EMIT modified();
}
开发者ID:ThunderPower,项目名称:keepassx,代码行数:14,代码来源:Metadata.cpp


示例20: allowedChars

Uuid ConverterDb::getOrCreateUuid(const QString& cat, const QString& key1,
                                  const QString& key2) {
  QString allowedChars(
      "_-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");

  QString settingsKey = mLibFilePath.getFilename() % '_' % key1 % '_' % key2;
  settingsKey.replace("{", "");
  settingsKey.replace("}", "");
  settingsKey.replace(" ", "_");
  for (int i = 0; i < settingsKey.length(); i++) {
    if (!allowedChars.contains(settingsKey[i]))
      settingsKey.replace(
          i, 1,
          QString("__U%1__").arg(
              QString::number(settingsKey[i].unicode(), 16).toUpper()));
  }
  settingsKey.prepend(cat % '/');

  Uuid    uuid  = Uuid::createRandom();
  QString value = mIniFile.value(settingsKey).toString();
  if (!value.isEmpty()) uuid = Uuid::fromString(value);  // can throw
  mIniFile.setValue(settingsKey, uuid.toStr());
  return uuid;
}
开发者ID:LibrePCB,项目名称:LibrePCB,代码行数:24,代码来源:converterdb.cpp



注:本文中的Uuid类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ V类代码示例发布时间:2022-05-31
下一篇:
C++ UtlVoidPtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap