src/lib/BasicASN1Reader.h
branchv_0
changeset 34 c15dc8762bdb
parent 33 13aa7280ac7b
child 35 bf2c546f49d1
equal deleted inserted replaced
33:13aa7280ac7b 34:c15dc8762bdb
   256 			std::vector<uint8_t> temp(typeHeader.length, 0);
   256 			std::vector<uint8_t> temp(typeHeader.length, 0);
   257 			read(temp.data(), typeHeader.length);
   257 			read(temp.data(), typeHeader.length);
   258 			// TODO: recover transaction?
   258 			// TODO: recover transaction?
   259 
   259 
   260 			std::stringstream description;
   260 			std::stringstream description;
   261 			description << "value:"
   261 			description << "UNKNOWN:"
   262 					<< " tag = " << typeHeader.tag
   262 					<< " tag = " << typeHeader.tag
   263 					<< " tagClass = " << (int) typeHeader.tagClass
   263 					<< " tagClass = " << (int) typeHeader.tagClass
   264 					<< " pc = " << (int) typeHeader.pc
   264 					<< " pc = " << (int) typeHeader.pc
   265 					<< " length = " << typeHeader.length
   265 					<< " length = " << typeHeader.length
   266 					<< " definite = " << (typeHeader.definiteLength ? "true" : "false");
   266 					<< " definite = " << (typeHeader.definiteLength ? "true" : "false")
   267 
   267 					<< " hex = ";
       
   268 			description << std::hex << std::setfill('0');
       
   269 			for (uint8_t b : temp) description << std::setw(2) << (int) b;
       
   270 			description << " ascii = ";
       
   271 			for (uint8_t b : temp) description << (b >= 32 && b < 127 ? (char) b : '.');
   268 			// TODO: special event for unparsed? (instead of a text string)
   272 			// TODO: special event for unparsed? (instead of a text string)
   269 			handlers->writeTextString(typeHeader, description.str());
   273 			handlers->writeTextString(typeHeader, description.str());
   270 		}
   274 		}
   271 
   275 
   272 		commit();
   276 		commit();