本文整理汇总了C++中MgCommand::GetReturnValue方法的典型用法代码示例。如果您正苦于以下问题:C++ MgCommand::GetReturnValue方法的具体用法?C++ MgCommand::GetReturnValue怎么用?C++ MgCommand::GetReturnValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MgCommand
的用法示例。
在下文中一共展示了MgCommand::GetReturnValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumerateResourceDocuments
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate the resource documents in the specified repository.
///
STRING MgProxyResourceService::EnumerateResourceDocuments(
MgStringCollection* resources, CREFSTRING type, INT32 properties)
{
STRING resourceList;
MgCommand cmd;
MG_TRY()
cmd.ExecuteCommand(
m_connProp, // Connection
MgCommand::knString, // Return type
MgResourceService::opIdEnumerateResourceDocuments, // Command code
3, // Number of arguments
Resource_Service, // Service ID
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knObject, resources, // Argument #1
MgCommand::knString, &type, // Argument #2
MgCommand::knInt32, properties, // Argument #3
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
resourceList = *(cmd.GetReturnValue().val.m_str);
delete cmd.GetReturnValue().val.m_str;
MG_CATCH_AND_THROW(L"MgProxyResourceService.EnumerateResourceDocuments")
return resourceList;
}
示例2: EnumerateResources
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerates the resources in the specified repository.
/// Resources of all types can be enumerated all at once, or only
/// resources of a given type.
///
MgByteReader* MgProxyResourceService::EnumerateResources(
MgResourceIdentifier* resource, INT32 depth, CREFSTRING type,
INT32 properties, CREFSTRING fromDate, CREFSTRING toDate, bool computeChildren)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knObject,
MgResourceService::opIdEnumerateResources,
7,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knObject, resource,
MgCommand::knInt32, depth,
MgCommand::knString, &type,
MgCommand::knInt32, properties,
MgCommand::knString, &fromDate,
MgCommand::knString, &toDate,
MgCommand::knInt8, (int)computeChildren,
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
示例3: EnumerateParentMapDefinitions
///////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate all the parent Map Definition resources of the specified
/// resources.
///
MgSerializableCollection* MgProxyResourceService::EnumerateParentMapDefinitions(
MgSerializableCollection* resources)
{
MgCommand cmd;
MG_TRY()
assert(m_connProp != NULL);
cmd.ExecuteCommand(
m_connProp, // Connection
MgCommand::knObject, // Return type
MgResourceService::opIdEnumerateParentMapDefinitions, // Command code
1, // Number of arguments
Resource_Service, // Service ID
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knObject, resources, // Argument #1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
MG_CATCH_AND_THROW(L"MgProxyResourceService.EnumerateParentMapDefinitions")
return (MgSerializableCollection*)cmd.GetReturnValue().val.m_obj;
}
示例4: GetResourceContents
///////////////////////////////////////////////////////////////////////////
/// \brief
/// Gets the contents of the specified resources.
///
MgStringCollection* MgProxyResourceService::GetResourceContents(MgStringCollection* resources,
MgStringCollection* preProcessTags)
{
Ptr<MgStringCollection> resourceContents;
MG_TRY()
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgResourceService::opIdGetResourceContents, // Command Code
2, // Count of arguments
Resource_Service, // Service Id
BUILD_VERSION(2,2,0), // Operation version
MgCommand::knObject, resources, // Argument#1
MgCommand::knObject, preProcessTags, // Argument#2
MgCommand::knNone); // End of argument
SetWarning(cmd.GetWarningObject());
resourceContents = (MgStringCollection*)cmd.GetReturnValue().val.m_obj;
// Decrypt the document if Substitution pre-processing is required.
if(preProcessTags != NULL && resourceContents != NULL && preProcessTags->GetCount() == resourceContents->GetCount())
{
for(INT32 i = 0; i < resourceContents->GetCount(); i ++)
{
STRING tag = preProcessTags->GetItem(i);
if (MgResourcePreProcessingType::Substitution == tag)
{
STRING cipherContent = resourceContents->GetItem(i);
string cipherText, plainText;
MgUtil::WideCharToMultiByte(cipherContent, cipherText);
MG_CRYPTOGRAPHY_TRY()
MgCryptographyUtil cryptoUtil;
cryptoUtil.DecryptString(cipherText, plainText);
MG_CRYPTOGRAPHY_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceContents")
STRING decryptedContent;
MgUtil::MultiByteToWideChar(plainText, decryptedContent);
resourceContents->SetItem(i, decryptedContent);
}
}
}
MG_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceContents")
return resourceContents.Detach();
}
示例5: GetSiteVersion
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the site version.
/// </summary>
/// <returns>
/// The site version.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
STRING MgServerAdmin::GetSiteVersion()
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knString, // Return type expected
MgServerAdminServiceOpId::GetSiteVersion, // Command Code
0, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
STRING retVal = *(cmd.GetReturnValue().val.m_str);
delete cmd.GetReturnValue().val.m_str;
return retVal;
}
示例6: GetResourceData
///////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Returns tagged data for the specified resource.
/// </summary>
/// <param name="resource">
/// Resource identifier describing the resource.
/// </param>
/// <param name="dataName">
/// Name for data. Either a resource-unique stream name for streams or a
/// resource-unique file name for file data.
/// </param>
/// <param name="preProcessTags">
/// Pre-processing to apply to resource data before returning. An empty
/// string indicate no pre-processing. See MgResourcePreProcessingType for
/// a list of supported pre-processing tags.
/// </param>
/// <returns>
/// MgByteReader containing the previously updated or added tagged data.
/// </returns>
/// EXCEPTIONS:
/// MgRepositoryNotOpenException
///
/// MgResourceDataNotFoundException
/// MgInvalidResourceTypeException
///
MgByteReader* MgProxyResourceService::GetResourceData(
MgResourceIdentifier* resource, CREFSTRING dataName,
CREFSTRING preProcessTags)
{
Ptr<MgByteReader> byteReader;
MG_TRY()
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knObject,
MgResourceService::opIdGetResourceData,
3,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knObject, resource,
MgCommand::knString, &dataName,
MgCommand::knString, &preProcessTags,
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
byteReader = (MgByteReader*)cmd.GetReturnValue().val.m_obj;
// Decrypt the document if Substitution pre-processing is required.
if (MgResourcePreProcessingType::Substitution == preProcessTags
&& byteReader != NULL)
{
STRING mimeType = byteReader->GetByteSource()->GetMimeType();
string cipherText, plainText;
byteReader->ToStringUtf8(cipherText);
MG_CRYPTOGRAPHY_TRY()
MgCryptographyUtil cryptoUtil;
cryptoUtil.DecryptString(cipherText, plainText);
MG_CRYPTOGRAPHY_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceData")
Ptr<MgByteSource> byteSource = new MgByteSource(
(BYTE_ARRAY_IN)plainText.c_str(), (INT32)plainText.length());
byteSource->SetMimeType(mimeType);
byteReader = byteSource->GetReader();
}
MG_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceData")
return byteReader.Detach();
}
示例7: IsOnline
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the online status of the server.
/// </summary>
/// <returns>
/// True for online, False for offline.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
bool MgServerAdmin::IsOnline()
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knInt8, // Return type expected
MgServerAdminServiceOpId::IsOnline, // Command Code
0, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (bool)cmd.GetReturnValue().val.m_i8;
}
示例8: EnumeratePackages
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Enumerates the packages available in the package directory.
/// </summary>
///
/// <returns>
/// An MgStringCollection containing a list of packages in the packages directory
/// </returns>
///
/// EXCEPTIONS:
/// MgOutOfMemoryException
/// MgFileNotFoundException
/// MgFileIoException
MgStringCollection* MgServerAdmin::EnumeratePackages()
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgServerAdminServiceOpId::EnumeratePackages, // Command Code
0, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgStringCollection*)cmd.GetReturnValue().val.m_obj;
}
示例9: EnumerateRepositories
//////////////////////////////////////////////////////////////////
/// <summary>
/// Gets a list of entries for the specified repository type. The
/// following lists will be returned for the specified repository
/// type:
/// 1) Session - A list of session IDs is returned.
///
/// This method only works on "Session" repositories.
/// If you specify a repository that is not supported this method
/// will throw an MgInvalidRepositoryTypeException exception.
/// </summary>
/// <param name="repositoryType">
/// The type of repository you want to list the entries for.
/// The following repositories are supported:
/// 1) Session
/// </param>
/// <returns>
/// MgByteReader object representing the list of entries for the
/// repository type specified.
/// </returns>
/// EXCEPTIONS:
/// MgOutOfMemoryException
/// MgInvalidRepositoryTypeException
MgByteReader* MgProxyResourceService::EnumerateRepositories(CREFSTRING repositoryType)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knObject,
MgResourceService::opIdEnumerateRepositories,
1,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knString, &repositoryType,
MgCommand::knNone);
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
示例10: ClearLog
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Clears the specified log.
/// </summary>
/// <param name="log">
/// The log to be cleared. (AccessLog, AdminLog, AuthenticationLog, ErrorLog,
/// SessionLog, TraceLog)
/// </param>
/// <returns>
/// True if the log was successfully cleared, false otherwise.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidArgumentException
/// MgNullReferenceException
bool MgServerAdmin::ClearLog(CREFSTRING log)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knInt8, // Return type expected
MgServerAdminServiceOpId::ClearLog, // Command Code
1, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &log, // Argument#1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (bool)cmd.GetReturnValue().val.m_i8;
}
示例11: GetResourceHeader
//////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the header associated with the specified resource.
/// </summary>
/// <param name="resource">
/// Resource identifier for desired resource
/// </param>
/// <returns>
/// MgByteReader object representing the XML resource header.
/// </returns>
/// EXCEPTIONS:
/// MgRepositoryNotOpenException
///
/// MgInvalidResourceTypeException
MgByteReader* MgProxyResourceService::GetResourceHeader(MgResourceIdentifier* resource)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knObject,
MgResourceService::opIdGetResourceHeader,
1,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knObject, resource,
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
示例12: GetPackageLog
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets current log of the specified package
/// </summary>
///
/// <param name="packageName">
/// The name of the package to get the status for. Available packages can be
/// found by using EnumeratePackages().
/// </param>
///
/// <returns>
/// An MgByteReader containing the contents of the package's log.
/// </returns>
///
/// EXCEPTIONS:
/// MgFileNotFoundException
/// MgFileIoException
/// MgInvalidArgumentException
/// MgOutOfMemoryException
MgByteReader* MgServerAdmin::GetPackageLog(CREFSTRING packageName)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgServerAdminServiceOpId::GetPackageLog, // Command Code
1, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &packageName, // Argument #1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
示例13: ResourceExists
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Checks to see if the specified resource exists.
///
bool MgProxyResourceService::ResourceExists(MgResourceIdentifier* resource)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knInt8, // Return type expected
MgResourceService::opIdResourceExists, // Command code
1, // Number of arguments
Resource_Service, // Service ID
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knObject, resource, // Argument #1
MgCommand::knNone); // End of argument
SetWarning(cmd.GetWarningObject());
return (bool)cmd.GetReturnValue().val.m_i8;
}
示例14: GetConfigurationProperties
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the configuration properties for the specified property section.
/// </summary>
/// <param name="propertySection">
/// The property section to get.
/// </param>
/// <returns>
/// The collection of configuration properties associated with the specified property section.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidPropertySectionException
/// MgPropertySectionNotAvailableException
MgPropertyCollection* MgServerAdmin::GetConfigurationProperties(CREFSTRING propertySection)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgServerAdminServiceOpId::GetConfigurationProperties, // Command Code
1, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &propertySection, // Argument#1
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgPropertyCollection*)cmd.GetReturnValue().val.m_obj;
}
示例15: GetLog
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the contents of the specified log between two dates. A maximum 24 hour
/// period is allowed to be retrieved. This will use the current file name convention
/// for the log so if the filename was changed it will be unable to find entries
/// located previous files.
/// </summary>
/// <param name="log">
/// The log to retrieve. (AccessLog, AdminLog, AuthenticationLog, ErrorLog,
/// MapLayerAccessLog, SessionLog, TraceLog)
/// </param>
/// <param name="fromDate">
/// Date & time to start pulling entries from
/// </param>
/// <param name="toDate">
/// Last date & time to pull entries for
/// </param>
/// <returns>
/// The log contents in a ByteReader.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidLogTypeException
/// MgNullReferenceException
/// MgInvalidArgumentException
/// MgOutOfMemoryException
MgByteReader* MgServerAdmin::GetLog(CREFSTRING log, MgDateTime* fromDate, MgDateTime* toDate)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp, // Connection
MgCommand::knObject, // Return type expected
MgServerAdminServiceOpId::GetLog, // Command Code
3, // No of arguments
ServerAdmin_Service, // Service Id
BUILD_VERSION(1,0,0), // Operation version
MgCommand::knString, &log, // Argument#1
MgCommand::knObject, fromDate, // Argument#2
MgCommand::knObject, toDate, // Argument#3
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}