Changeset 2660 in Sophya for trunk/SophyaLib/BaseTools/ppfbinstream.cc
- Timestamp:
- Apr 7, 2005, 11:49:11 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/ppfbinstream.cc
r2615 r2660 1007 1007 char * buff; 1008 1008 string str; 1009 1009 // Pour indenter lors de l'impression 1010 #define _MXINDENT_ 10 1011 char * indents[_MXINDENT_+1] = {""," ", " ", " ", " ", " ", 1012 " ", " ", " ", 1013 " ", " "}; 1014 int idxindent = 0; 1015 int idxind = 0; 1010 1016 cout << "\n ---------------------------------------------------------- " << endl; 1011 1017 cout << " PPFBinaryInputStream::AnalyseTags(Level= " << lev << ")" << endl; … … 1041 1047 1042 1048 case PPS_NULL : 1043 if (lev > 1) cout << "<PPS_NULL> tag at position " << hex << cpos << dec << endl; 1049 if (lev > 1) cout << indents[idxindent] 1050 << "<PPS_NULL> tag at position " << hex << cpos << dec << endl; 1044 1051 break; 1045 1052 1046 1053 case PPS_STRING : 1047 1054 GetRawI4(i4); 1048 if (lev > 1) cout << "<PPS_STRING> tag at position " << hex << cpos << dec 1055 if (lev > 1) cout << indents[idxindent] 1056 << "<PPS_STRING> tag at position " << hex << cpos << dec 1049 1057 << " Length=" << i4 << endl; 1050 1058 s->seekg(i4,ios::cur); … … 1054 1062 GetRawU8(cid); 1055 1063 GetRawU8(oid); 1056 cout << "<PPS_OBJECT> tag at position " << hex << cpos << " ClassId= " << cid 1064 cout << indents[idxindent] 1065 << "<PPS_OBJECT> tag at position " << hex << cpos << " ClassId= " << cid 1057 1066 << " ObjectId= " << oid << dec << endl; 1067 idxind++; 1068 idxindent = (idxind <= _MXINDENT_) ? idxind : _MXINDENT_; 1058 1069 break; 1059 1070 … … 1061 1072 GetRawU8(oid); 1062 1073 GetRawI8(i8); 1063 cout << "<PPS_REFERENCE> tag at position " << hex << cpos << " ObjectId= " 1074 cout << indents[idxindent] 1075 << "<PPS_REFERENCE> tag at position " << hex << cpos << " ObjectId= " 1064 1076 << oid << " OrigPos=" << i8 << dec << endl; 1065 1077 break; 1066 1078 1067 1079 case PPS_NAMETAG_MARK : 1068 cout << "<PPS_NAMETAG_MARK> tag at position " << hex << cpos << dec << endl; 1080 cout << indents[idxindent] 1081 << "<PPS_NAMETAG_MARK> tag at position " << hex << cpos << dec << endl; 1069 1082 break; 1070 1083 1071 1084 case PPS_POSTAG_MARK : 1072 1085 GetRawI8(i8); 1073 cout << "<PPS_POSTAG_MARK> tag at position " << hex << cpos 1086 cout << indents[idxindent] 1087 << "<PPS_POSTAG_MARK> tag at position " << hex << cpos 1074 1088 << " TPos=" << i8 << dec << endl; 1075 1089 break; … … 1077 1091 case PPS_ENDOBJECT : 1078 1092 GetRawU8(oid); 1079 cout << "<PPS_ENDOBJECT> tag at position " << hex << cpos << " ObjectId= " 1093 cout << indents[idxindent] 1094 << "<PPS_ENDOBJECT> tag at position " << hex << cpos << " ObjectId= " 1080 1095 << oid << dec << endl; 1096 idxind--; 1097 idxindent = (idxind >= 0) ? idxind : 0; 1081 1098 break; 1082 1099 … … 1084 1101 GetRawI4(i4); 1085 1102 for(int kkt=0; kkt<i4; kkt++) GetRawI8(i8); 1086 cout << "<PPS_POSTAG_TABLE> tag at position " << hex << cpos << dec << endl; 1103 cout << indents[idxindent] 1104 << "<PPS_POSTAG_TABLE> tag at position " << hex << cpos << dec << endl; 1087 1105 break; 1088 1106 … … 1095 1113 buff[i4] = '\0'; str = buff; 1096 1114 delete[] buff; 1097 cout << "<PPS_NAMETAG_TABLE> tag at position " << hex << cpos << dec 1115 cout << indents[idxindent] 1116 << "<PPS_NAMETAG_TABLE> tag at position " << hex << cpos << dec 1098 1117 << " Name= " << str << endl; 1099 1118 } 1100 1119 else { 1101 cout << "<PPS_NAMETAG_TABLE> tag at position " << hex << cpos << dec << endl; 1120 cout << indents[idxindent] 1121 << "<PPS_NAMETAG_TABLE> tag at position " << hex << cpos << dec << endl; 1102 1122 int_8 stats[8]; 1103 1123 GetI8s(stats,8); … … 1117 1137 case PPS_EOF : 1118 1138 if (Version() < 3) GetRawI8(i8); 1119 cout << "<PPS_EOF> tag at position " << hex << cpos 1139 cout << indents[idxindent] 1140 << "<PPS_EOF> tag at position " << hex << cpos 1120 1141 << " TagPos=" << i8 << dec << endl; 1121 1142 eofok = true; … … 1148 1169 1149 1170 case PPS_SIMPLE : 1150 if (lev > 2) cout << "<PPS_SIMPLE> tag at position " << hex << cpos << dec 1171 if (lev > 2) cout << indents[idxindent] 1172 << "<PPS_SIMPLE> tag at position " << hex << cpos << dec 1151 1173 << " DataType=" << dtype << endl; 1152 1174 s->seekg(dsizeskip, ios::cur); … … 1155 1177 case PPS_SIMPLE_ARRAY4 : 1156 1178 GetRawI4(i4); 1157 if (lev > 0) cout << "<PPS_SIMPLE_ARRAY4> tag at position " << hex << cpos << dec 1179 if (lev > 0) cout << indents[idxindent] 1180 << "<PPS_SIMPLE_ARRAY4> tag at position " << hex << cpos << dec 1158 1181 << " DataType=" << dtype << " NElts= " << i4 << endl; 1159 1182 s->seekg(dsizeskip*(int_8)i4, ios::cur); … … 1162 1185 case PPS_SIMPLE_ARRAY8 : 1163 1186 GetRawU8(ui8); 1164 if (lev > 0) cout << "<PPS_SIMPLE_ARRAY8> tag at position " << hex << cpos << dec 1187 if (lev > 0) cout << indents[idxindent] 1188 << "<PPS_SIMPLE_ARRAY8> tag at position " << hex << cpos << dec 1165 1189 << " DataType=" << dtype << " NElts= " << ui8 << endl; 1166 1190 s->seekg(dsizeskip*ui8, ios::cur);
Note:
See TracChangeset
for help on using the changeset viewer.