MCPcopy Create free account
hub / github.com/MediaArea/MediaInfoLib / Print

Method Print

Source/MediaInfo/File__Analyze_Element.cpp:953–984  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

951
952//---------------------------------------------------------------------------
953int element_details::Element_Node::Print(MediaInfo_Config::trace_Format Format, std::string& Str, const string& eol, int64u File_Size)
954{
955 //Computing how many characters are needed for displaying maximum file size
956 size_t offset_size = sizeof(File_Size)*8-1;
957 while (offset_size>1 && (((int64u)1) << offset_size) - 1 >= File_Size)
958 offset_size--;
959 offset_size++;
960 offset_size = (offset_size / 4) + ((offset_size % 4) ? 1 : 0); //4 bits per offset char
961
962 std::ostringstream ss;
963 int ret = -1;
964 print_struc s(ss, eol, offset_size);
965 switch (Format)
966 {
967 case MediaInfo_Config::Trace_Format_Tree:
968 s.level = 1;
969 ret = Print_Tree(s);
970 break;
971 case MediaInfo_Config::Trace_Format_CSV:
972 break;
973 case MediaInfo_Config::Trace_Format_XML:
974 ret = Print_Xml(s);
975 break;
976 case MediaInfo_Config::Trace_Format_MICRO_XML:
977 ret = Print_Micro_Xml(s);
978 break;
979 default:
980 break;
981 }
982 Str = ss.str();
983 return ret;
984}
985
986//---------------------------------------------------------------------------
987void element_details::Element_Node::Add_Child(Element_Node* node)

Callers 2

Details_GetMethod · 0.45
Open_Buffer_FinalizeMethod · 0.45

Calls 1

strMethod · 0.45

Tested by

no test coverage detected