NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <objects/general/uoconv.hpp>
#include <objects/general/Object_id.hpp>
#include <objects/general/User_field.hpp>
#include <objects/general/User_object.hpp>
#include <objects/misc/error_codes.hpp>
#include <serial/objectiter.hpp>
#include <util/bitset/bmserial.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Macros | |
#define | NCBI_USE_ERRCODE_X Objects_UOConv |
Typedefs | |
typedef CUser_field::TData | TUFData |
typedef TUFData::TOs | TUFDOs |
Functions | |
static CRef< CUser_field > | s_PackAsUserField (CConstObjectInfo obj, const string *label=0) |
static void | s_SetOSFromBS (TUFDOs &os, CBitString &bs) |
static void | s_SetBSFromOS (CBitString &bs, const TUFDOs &os) |
static void | s_SetFieldsFromAnyContent (CUser_field &parent, const CAnyContentObject &obj) |
static void | s_SetAnyContentFromFields (CAnyContentObject &obj, const TUFData::TFields &fields) |
static void | s_SetPrimitiveData (CUser_field &field, CConstObjectInfo obj) |
static size_t | s_SetContainerData (TUFData &data, CConstObjectInfo obj) |
CRef< CUser_object > | PackAsUserObject (CConstObjectInfo obj) |
static void | s_UnpackUserField (const CUser_field &uo, CObjectInfo obj) |
static void | s_UnpackPrimitiveField (const TUFData &data, CObjectInfo obj) |
static void | s_UnpackContainerField (const TUFData &data, CObjectInfo obj) |
void | UnpackUserObject (const CUser_object &uo, CObjectInfo obj) |
CObjectInfo | UnpackUserObject (const CUser_object &uo, const CTypeInfo *ti) |
#define NCBI_USE_ERRCODE_X Objects_UOConv |
Definition at line 51 of file uoconv.cpp.
typedef CUser_field::TData TUFData |
Definition at line 56 of file uoconv.cpp.
typedef TUFData::TOs TUFDOs |
Definition at line 57 of file uoconv.cpp.
CRef<CUser_object> PackAsUserObject | ( | CConstObjectInfo | obj | ) |
Definition at line 408 of file uoconv.cpp.
References CTypeInfo::GetModuleName(), CTypeInfo::GetName(), CObjectTypeInfo::GetTypeInfo(), s_PackAsUserField(), CUser_object_Base::SetClass(), CUser_object_Base::SetData(), and CUser_object_Base::SetType().
|
static |
Definition at line 348 of file uoconv.cpp.
References CConstObjectInfo::BeginMembers(), data, eTypeFamilyChoice, eTypeFamilyClass, eTypeFamilyContainer, eTypeFamilyPointer, eTypeFamilyPrimitive, CObjectTypeInfoCV::GetAlias(), CObjectTypeInfo::GetClassTypeInfo(), CConstObjectInfo::GetCurrentChoiceVariant(), CClassTypeInfoBase::GetItems(), CConstObjectInfo::GetPointedObject(), CObjectTypeInfo::GetTypeFamily(), label, CItemsInfo::LastIndex(), s_SetContainerData(), s_SetPrimitiveData(), CUser_field_Base::SetData(), CUser_field_Base::SetLabel(), CUser_field_Base::SetNum(), and CUser_field::SetNumFromSize().
Referenced by PackAsUserObject(), and s_SetContainerData().
|
static |
Definition at line 116 of file uoconv.cpp.
References CAnyContentObject::AddAttribute(), ITERATE, NCBI_THROW, NPOS, CAnyContentObject::SetName(), CAnyContentObject::SetNamespaceName(), CAnyContentObject::SetNamespacePrefix(), CAnyContentObject::SetValue(), and rapidjson::value.
Referenced by s_UnpackPrimitiveField().
|
static |
Definition at line 82 of file uoconv.cpp.
References _ASSERT, CResizingIterator< TSeq, TVal >::AtEnd(), CHAR_BIT, count, bm::deserialize(), i, and bm::bvector< Alloc >::resize().
Referenced by s_UnpackContainerField(), and s_UnpackPrimitiveField().
|
static |
Definition at line 213 of file uoconv.cpp.
References CUtf8::AsUTF8(), CConstObjectInfo::BeginElements(), count, data, eEncoding_ISO8859_1, eEncoding_UTF8, ePrimitiveValueAny, ePrimitiveValueBitString, ePrimitiveValueBool, ePrimitiveValueChar, ePrimitiveValueEnum, ePrimitiveValueInteger, ePrimitiveValueOctetString, ePrimitiveValueOther, ePrimitiveValueReal, ePrimitiveValueSpecial, ePrimitiveValueString, ERR_POST_X, eTypeFamilyPointer, eTypeFamilyPrimitive, CObjectTypeInfo::GetContainerTypeInfo(), CContainerTypeInfo::GetElementCount(), CObjectTypeInfo::GetElementType(), CConstObjectInfo::GetObjectPtr(), CConstObjectInfo::GetPointedObject(), CConstObjectInfo::GetPrimitiveValueAnyContent(), CConstObjectInfo::GetPrimitiveValueBitString(), CConstObjectInfo::GetPrimitiveValueBool(), CConstObjectInfo::GetPrimitiveValueChar(), CConstObjectInfo::GetPrimitiveValueDouble(), CConstObjectInfo::GetPrimitiveValueInt(), CConstObjectInfo::GetPrimitiveValueOctetString(), CConstObjectInfo::GetPrimitiveValueString(), CObjectTypeInfo::GetPrimitiveValueType(), CConstObjectInfo::GetPrimitiveValueUInt(), CObjectTypeInfo::GetTypeFamily(), NStr::IntToString(), CObjectTypeInfo::IsPrimitiveValueSigned(), s_PackAsUserField(), s_SetFieldsFromAnyContent(), s_SetOSFromBS(), and Warning().
Referenced by s_PackAsUserField().
|
static |
Definition at line 100 of file uoconv.cpp.
References CUser_field::AddField(), CAnyContentObject::GetAttributes(), CAnyContentObject::GetName(), CAnyContentObject::GetNamespaceName(), CAnyContentObject::GetNamespacePrefix(), CAnyContentObject::GetValue(), ITERATE, and CUser_field::SetNumFromSize().
Referenced by s_SetContainerData(), and s_SetPrimitiveData().
|
static |
Definition at line 62 of file uoconv.cpp.
References CConstResizingIterator< TSeq, TOut >::AtEnd(), CHAR_BIT, i, n, bm::serialize(), and st().
Referenced by s_SetContainerData(), and s_SetPrimitiveData().
|
static |
Definition at line 141 of file uoconv.cpp.
References CUtf8::AsUTF8(), buf, CUtf8::CharToSymbol(), data, eEncoding_ISO8859_1, ePrimitiveValueAny, ePrimitiveValueBitString, ePrimitiveValueBool, ePrimitiveValueChar, ePrimitiveValueEnum, ePrimitiveValueInteger, ePrimitiveValueOctetString, ePrimitiveValueOther, ePrimitiveValueReal, ePrimitiveValueSpecial, ePrimitiveValueString, ERR_POST_X, CConstObjectInfo::GetPrimitiveValueAnyContent(), CConstObjectInfo::GetPrimitiveValueBitString(), CConstObjectInfo::GetPrimitiveValueBool(), CConstObjectInfo::GetPrimitiveValueChar(), CConstObjectInfo::GetPrimitiveValueDouble(), CConstObjectInfo::GetPrimitiveValueInt(), CConstObjectInfo::GetPrimitiveValueOctetString(), CConstObjectInfo::GetPrimitiveValueString(), CObjectTypeInfo::GetPrimitiveValueType(), CConstObjectInfo::GetPrimitiveValueUInt(), CObjectTypeInfo::IsPrimitiveValueSigned(), s_SetFieldsFromAnyContent(), s_SetOSFromBS(), CUser_field_Base::SetData(), and Warning().
Referenced by s_PackAsUserField().
|
static |
Definition at line 488 of file uoconv.cpp.
References CTypeInfo::Create(), data, CTypeInfo::Delete(), CUser_field_Base::C_Data::e_Fields, CUser_field_Base::C_Data::e_Ints, CUser_field_Base::C_Data::e_Oss, CUser_field_Base::C_Data::e_Reals, CUser_field_Base::C_Data::e_Strs, CConstObjectInfo::eNonCObject, ePrimitiveValueBitString, ePrimitiveValueBool, ePrimitiveValueChar, ePrimitiveValueEnum, ePrimitiveValueInteger, ePrimitiveValueOctetString, ePrimitiveValueReal, ePrimitiveValueSpecial, ePrimitiveValueString, eTypeFamilyPrimitive, CObjectTypeInfo::GetContainerTypeInfo(), CObjectTypeInfo::GetElementType(), CObjectInfo::GetObjectPtr(), CObjectTypeInfo::GetPrimitiveValueType(), CObjectTypeInfo::GetTypeFamily(), CObjectTypeInfo::GetTypeInfo(), CTypeInfo::IsCObject(), CObjectTypeInfo::IsPrimitiveValueSigned(), ITERATE, NCBI_THROW, CContainerTypeInfo::ReserveElements(), s_SetBSFromOS(), s_UnpackUserField(), CObjectInfo::SetPrimitiveValueBitString(), CObjectInfo::SetPrimitiveValueBool(), CObjectInfo::SetPrimitiveValueChar(), CObjectInfo::SetPrimitiveValueDouble(), CObjectInfo::SetPrimitiveValueInt(), CObjectInfo::SetPrimitiveValueOctetString(), CObjectInfo::SetPrimitiveValueString(), CObjectInfo::SetPrimitiveValueUInt(), and NStr::StringToInt().
Referenced by s_UnpackUserField().
|
static |
Definition at line 420 of file uoconv.cpp.
References data, CUser_field_Base::C_Data::e_Int, CUser_field_Base::C_Data::e_Str, ePrimitiveValueAny, ePrimitiveValueBitString, ePrimitiveValueBool, ePrimitiveValueChar, ePrimitiveValueEnum, ePrimitiveValueInteger, ePrimitiveValueOctetString, ePrimitiveValueOther, ePrimitiveValueReal, ePrimitiveValueSpecial, ePrimitiveValueString, ERR_POST_X, CObjectTypeInfo::GetPrimitiveValueType(), CObjectTypeInfo::IsPrimitiveValueSigned(), NCBI_THROW, s_SetAnyContentFromFields(), s_SetBSFromOS(), CObjectInfo::SetPrimitiveValueAnyContent(), CObjectInfo::SetPrimitiveValueBitString(), CObjectInfo::SetPrimitiveValueBool(), CObjectInfo::SetPrimitiveValueChar(), CObjectInfo::SetPrimitiveValueDouble(), CObjectInfo::SetPrimitiveValueInt(), CObjectInfo::SetPrimitiveValueOctetString(), CObjectInfo::SetPrimitiveValueString(), CObjectInfo::SetPrimitiveValueUInt(), and Warning().
Referenced by s_UnpackUserField().
|
static |
Definition at line 637 of file uoconv.cpp.
References _ASSERT, data, CObject_id_Base::e_Id, CObject_id_Base::e_Str, eTypeFamilyChoice, eTypeFamilyClass, eTypeFamilyContainer, eTypeFamilyPointer, eTypeFamilyPrimitive, CObjectInfo::FindClassMember(), CObjectTypeInfo::FindVariantIndex(), CObjectTypeInfo::GetChoiceTypeInfo(), CObjectInfo::GetCurrentChoiceVariant(), CUser_field_Base::GetData(), CObject_id_Base::GetId(), CUser_field_Base::GetLabel(), CObjectInfo::GetObjectPtr(), CObjectInfo::GetPointedObject(), CObject_id_Base::GetStr(), CObjectTypeInfo::GetTypeFamily(), CObjectInfoMI::IsSet(), ITERATE, kInvalidMember, s_UnpackContainerField(), s_UnpackPrimitiveField(), CChoiceTypeInfo::SetIndex(), NStr::ToLower(), and CObject_id_Base::Which().
Referenced by s_UnpackContainerField(), and UnpackUserObject().
void UnpackUserObject | ( | const CUser_object & | uo, |
CObjectInfo | obj | ||
) |
Definition at line 702 of file uoconv.cpp.
References _ASSERT, CUser_object_Base::GetData(), CObjectInfo::GetObjectPtr(), and s_UnpackUserField().
Referenced by UnpackUserObject().
CObjectInfo UnpackUserObject | ( | const CUser_object & | uo, |
const CTypeInfo * | ti | ||
) |
Definition at line 708 of file uoconv.cpp.
References _ASSERT, and UnpackUserObject().