*** empty log message ***
[h316.git] / pc-tools / ldc2 / src / data_block.cpp
index f0c91538c0480daabbb430b16aa3fea01dc4b58e..6ebee44d78495648b8ce9bc7c61fbd03058aa357 100644 (file)
@@ -8,54 +8,73 @@
 
 using namespace std;
 
-data_block::data_block(tape_block& idol)
-  :tape_block(idol)
+/***************************************************************/
+/*!
+ *\brief Specialisation constructor.
+ */
+data_block::data_block(tape_block& org)
+  :tape_block(org)
 {
+  m_has_known_type=false;
 }
 
-data_block::~data_block(){
-}
-
+/***************************************************************/
+/*!
+ *\brief Determine block type.
+ *\return the block type extracted from the block's data.
+ */
 int data_block::get_type(){
-  if ((init_state==TBS_OK)&&word_data)
-    return (word_data[0]&0xf000)>>12;
-  else
- return block_type;
-}
-
-int data_block::get_subtype(){
-  if (get_type()==0)
-    return (new data_block_0(*this))->get_subtype();
-  else return 0;
+     return (word_data[0]&0xf000)>>12;
 }
 
+/***************************************************************/
 /*!
  *\brief Get the block's size in 16 bit words.
- *\return The block's 16-bit data buffer's size including header and checksum.
+ *\return The block's 16-bit data buffer's size including
+ *         header and checksum.
  */
 int data_block::get_word_size(){
   return word_size;
 }
 
+/***************************************************************/
+/*!
+ *\brief Describe the block.
+ *\return A vector of text lines describing this block.
+ */
+vector<string> data_block::get_description(){
+  vector<string> result;
+  string r_string="*****      "+get_typestring()+"Untyped data block, this \
+ is an illegal condition!";
+  result.insert(result.end(),r_string);
+  return result;
+}
+
+/***************************************************************/
 /*!
  *\brief Extract 6 byte symbol name from word memory.
  *
- *\param  startbyte the first byte of the desired symbol name
+ *\param  firstbyte the first byte of the desired symbol name
  *\return a string containing the symbol name. 
  *        Trailing spaces are included.
  *\note The word_data is handled system-intependently big endian!
  */
-string data_block::extract_string(int startbyte){
+string data_block::extract_label(int firstbyte){
   string result="";  // Start with empty string
   
   // We don't accept negative arguments!
-  if (startbyte<0) return result; 
+  if (firstbyte<0) return result; 
   
   // We also don't want segmentation faults!
-  if (word_size<(startbyte/2+1)) return result; 
+  if (word_size<(firstbyte/2+1)) return result; 
  
   // Here we pick out the characters.
-  for (int posi=startbyte;posi<startbyte+6;posi++)
+  for (int posi=firstbyte;posi<firstbyte+6;posi++)
     result+=(word_data[posi/2]>>(8*(1-posi%2)))&0x7f;
   return result;
 }
+
+
+
+
+