当前位置: 首页>>代码示例>>C++>>正文


C++ hm::String类代码示例

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


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

示例1: put_VacationMessageExpiresDate

STDMETHODIMP InterfaceAccount::put_VacationMessageExpiresDate(BSTR newVal)
{
   try
   {
      if (!object_)
         return GetAccessDenied();

      HM::String string = newVal;
      
      // Validate input date.
      if (string.Left(4) == _T("0000"))
         string = "";
   
      if (string.GetLength() == 0)
         string = Time::GetCurrentDate();
      else if (string.GetLength() != 10 || !Time::IsValidSystemDate(string))
         return COMError::GenerateError("Invalid auto-reply expiry date");
   
      object_->SetVacationExpiresDate(string);
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:David-Polehonski,项目名称:hmailserver,代码行数:27,代码来源:InterfaceAccount.cpp

示例2: GenerateGUID

STDMETHODIMP InterfaceUtilities::GenerateGUID(BSTR *Output)
{
   try
   {
      HM::String sOutput = HM::GUIDCreator::GetGUID();
      *Output = sOutput.AllocSysString();
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:bogri5520,项目名称:hMailServer,代码行数:13,代码来源:InterfaceUtilities.cpp

示例3:

HM::String _tagXMLEntitys::Ref2Entity( LPCTSTR estr )
{
	HM::String es;
	if( estr )
	{
		int len = _tcslen(estr);
		LPTSTR esbuf = es.GetBufferSetLength( len +1);
		if( esbuf )
			Ref2Entity( estr, esbuf, len );

      es.ReleaseBuffer();
	}
	return es;
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:14,代码来源:XMLite.cpp

示例4: Connect

STDMETHODIMP InterfaceApplication::Connect()
{
    try
    {
        HM::String sErrorMessage = HM::Application::Instance()->GetLastErrorMessage();
        if (!sErrorMessage.IsEmpty())
            return COMError::GenerateError(sErrorMessage);

        return S_OK;
    }
    catch (...)
    {
        return COMError::GenerateGenericMessage();
    }
}
开发者ID:digitalsoft,项目名称:hmailserver,代码行数:15,代码来源:InterfaceApplication.cpp

示例5: sInput

STDMETHODIMP InterfaceUtilities::SHA256(BSTR Input, BSTR *Output)
{
   try
   {
      HM::String sInput(Input);
   
      HM::String sOutput = HM::Crypt::Instance()->EnCrypt(sInput, HM::Crypt::ETSHA256);
   
      *Output = sOutput.AllocSysString();
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:bogri5520,项目名称:hMailServer,代码行数:17,代码来源:InterfaceUtilities.cpp

示例6: get_String

STDMETHODIMP InterfaceLanguage::get_String(BSTR EnglishString, BSTR *pVal)
{
   try
   {
      if (!language_)
         return GetAccessDenied();

      HM::String sText = language_->GetString(EnglishString);
      *pVal = sText.AllocSysString();
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:17,代码来源:InterfaceLanguage.cpp

示例7: GetAccessDenied

STDMETHODIMP 
InterfaceIMAPFolder::get_Name(BSTR *pVal)
{
   try
   {
      if (!m_pObject)
         return GetAccessDenied();

      HM::String sUnicode = HM::ModifiedUTF7::Decode(m_pObject->GetFolderName());
      *pVal = sUnicode.AllocSysString();
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:bogri5520,项目名称:hMailServer,代码行数:17,代码来源:InterfaceIMAPFolder.cpp

示例8: get_Name

STDMETHODIMP InterfaceLanguage::get_Name(BSTR *pVal)
{
   try
   {
      if (!language_)
         return GetAccessDenied();

      HM::String sName = language_->GetName();
      *pVal = sName.AllocSysString();
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:17,代码来源:InterfaceLanguage.cpp

示例9: String

HM::String _tagXMLEntitys::Entity2Ref( LPCTSTR str )
{
	HM::String s;
	if( str )
	{
		int nEntityCount = GetEntityCount(str);
		if( nEntityCount == 0 )
			return HM::String(str);
		int len = _tcslen(str) + nEntityCount*10 ;
		LPTSTR sbuf = s.GetBufferSetLength( len + 1 );
		if( sbuf )
			Entity2Ref( str, sbuf, len );

      s.ReleaseBuffer();
	}
	return s;
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:17,代码来源:XMLite.cpp

示例10: get_Address

STDMETHODIMP InterfaceTCPIPPort::get_Address(BSTR *pVal)
{
   try
   {
      if (!m_pObject)
         return GetAccessDenied();

      HM::String sIPAddress = m_pObject->GetAddressString();
      *pVal = sIPAddress.AllocSysString();
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:17,代码来源:InterfaceTCPIPPort.cpp

示例11: SetDefaultDatabase

STDMETHODIMP InterfaceDatabase::SetDefaultDatabase(eDBtype ServerType, BSTR ServerName, long lPort, BSTR DatabaseName, BSTR Username, BSTR Password)
{
   try
   {
      if (!GetIsServerAdmin())
         return GetAccessDenied();
   
      HM::String sEmpty;
      HM::String sServerName = ServerName;
      HM::String sDatabaseName = DatabaseName;
      HM::String sUsername = Username;
      HM::String sPassword = Password;
   
      if (sDatabaseName.Find(_T(" ")) >= 0)
         return COMError::GenerateError("The database name may not contain spaces.");
   
      // Create a settings object for the connection ...
      std::shared_ptr<HM::DatabaseSettings> pSettings = std::shared_ptr<HM::DatabaseSettings>(
         new HM::DatabaseSettings(sServerName, sEmpty, sUsername, sPassword, sEmpty, sEmpty,(HM::DatabaseSettings::SQLDBType) ServerType, lPort));
   
      // Connect to the database server.
      std::shared_ptr<HM::DALConnection> pConn = HM::DALConnectionFactory::CreateConnection(pSettings);
   
      HM::String sErrorMessage;
      if (pConn->Connect(sErrorMessage) != HM::DALConnection::Connected)
         return COMError::GenerateError(sErrorMessage);
   
      // Disconnect again.
      pConn->Disconnect();
   
      ini_file_settings_->SetDatabaseDirectory("");
      ini_file_settings_->SetDatabaseType((HM::DatabaseSettings::SQLDBType) ServerType);
      ini_file_settings_->SetUsername(sUsername);
      ini_file_settings_->SetPassword(sPassword);
      ini_file_settings_->SetDatabasePort(lPort);
      ini_file_settings_->SetDatabaseServer(sServerName);
      ini_file_settings_->SetDatabaseName(sDatabaseName);
      ini_file_settings_->SetIsInternalDatabase(ServerType == hDBTypeMSSQLCE);
   
      return S_OK;   
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}   
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:46,代码来源:InterfaceDatabase.cpp

示例12: Reinitialize

STDMETHODIMP InterfaceApplication::Reinitialize()
{
    try
    {
        if (!authentication_->GetIsServerAdmin())
            return authentication_->GetAccessDenied();

        HM::String sErrorMessage = HM::Application::Instance()->Reinitialize();
        if (!sErrorMessage.IsEmpty())
            return COMError::GenerateError(sErrorMessage);

        return S_OK;
    }
    catch (...)
    {
        return COMError::GenerateGenericMessage();
    }
}
开发者ID:digitalsoft,项目名称:hmailserver,代码行数:18,代码来源:InterfaceApplication.cpp

示例13: get_RecipientAddress

STDMETHODIMP InterfaceDistributionListRecipient::get_RecipientAddress(BSTR *pVal)
{
   try
   {
      if (!m_pObject)
         return GetAccessDenied();

   
   
      HM::String sVal = m_pObject->GetAddress();
      *pVal = sVal.AllocSysString();
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:19,代码来源:InterfaceDistributionListRecipient.cpp

示例14: GenerateError

HRESULT
InterfaceDatabase::EnsureDatabaseConnectivity_()
{
   db_manager_ = HM::Application::Instance()->GetDBManager();
   if (!db_manager_)
   {
      return COMError::GenerateError("The connection to the database is not available. Please check the hMailServer error log for details.");
   }

   if (!db_manager_->GetIsConnected())
   {
      HM::String sError;
      sError.Format(_T("The connection to the database is not available.\r\n%s"), HM::Application::Instance()->GetLastErrorMessage().c_str());

      return COMError::GenerateError(sError);
   }

   return S_OK;
}
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:19,代码来源:InterfaceDatabase.cpp

示例15: TestClamAVScanner

STDMETHODIMP InterfaceAntiVirus::TestClamAVScanner(BSTR hostname, long port, BSTR *messageText, VARIANT_BOOL *pResult)
{
   try
   {
      if (!GetIsServerAdmin())
         return GetAccessDenied();

      HM::VirusScannerTester testClient;
   
      HM::String text;
      *pResult = testClient.TestClamAVConnect(hostname, port, text) ? VARIANT_TRUE : VARIANT_FALSE;
      *messageText = text.AllocSysString();
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:20,代码来源:InterfaceAntiVirus.cpp


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