Changeset 247

Show
Ignore:
Timestamp:
07/29/2006 03:37:30 AM
Author:
luedi
Message:

added new decoders for:

  • Archive File/Project
  • Restore File/Project
  • Archive Versions of file

actions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ssphys/SSPhys/GetCommand.cpp

    r208 r247  
    107107  virtual bool Apply (const SSBranchFileAction& rAction)        { return Apply ((const SSAction&) rAction); } 
    108108  virtual bool Apply (const SSRollbackAction& rAction)          { return Apply ((const SSAction&) rAction); } 
    109   virtual bool Apply (const SSRestoreAction& rAction)           { return Apply ((const SSAction&) rAction); } 
     109  virtual bool Apply (const SSArchivedVersionsAction& rAction)  { return Apply ((const SSAction&) rAction); } 
     110  virtual bool Apply (const SSArchiveFileAction& rAction)       { return Apply ((const SSAction&) rAction); } 
     111  virtual bool Apply (const SSArchiveProjectAction& rAction)    { return Apply ((const SSAction&) rAction); } 
     112  virtual bool Apply (const SSRestoreFileAction& rAction)       { return Apply ((const SSAction&) rAction); } 
     113  virtual bool Apply (const SSRestoreProjectAction& rAction)    { return Apply ((const SSAction&) rAction); } 
    110114 
    111115  virtual bool Apply (const SSDestroyedProjectAction& rAction)  { return Apply ((const SSAction&) rAction); } 
     
    305309  } 
    306310 
     311  virtual bool Apply (const SSArchivedVersionsAction& rAction) 
     312  { 
     313    // end building the history at this point 
     314    return false; 
     315  } 
     316   
    307317  virtual bool Apply (const SSLabeledAction& rAction) 
    308318  { 
     
    712722      } 
    713723 
    714       version.GetAction ()->Accept (*pVisitor.get()); 
     724      if (!version.GetAction ()->Accept (*pVisitor.get())) 
     725        break; 
    715726    } 
    716727 
  • trunk/ssphys/SSPhysLib/SSTypes.cpp

    r157 r247  
    2828  "Action 18",          // missing action 18 
    2929  "RollBack",           // = 19 
    30   "Action 20",          // missing action 20 
    31   "Action 21",          // missing action 21 
    32   "Action 22",          // missing action 22 
    33   "Action 23",          // missing action 23 
    34   "Action 24",          // missing action 24 
    35   "Restore",            // = 25 
    36   // missing known actions: archives 
     30  "Archive Versions of File",  // = 20 
     31  "Action 19",          // missing action 19 
     32  "Archive File",      // = 22 
     33  "Archive Project",   // = 23 
     34  "Restored File",      // = 24 
     35  "Restored Project",   // = 25 
    3736 
    3837  /// --- pseudo actions --- 
  • trunk/ssphys/SSPhysLib/SSTypes.h

    r157 r247  
    150150  // missing action 18 
    151151  RollBack = 19, 
    152   // missing known actions: archives 
    153   Restore = 25, 
     152  ArchiveVersion_File = 20,  
     153  // missing action 21, probably RestoreVersion_File 
     154  Archive_File = 22, 
     155  Archive_Project = 23, 
     156  Restore_File = 24, 
     157  Restore_Project = 25, 
    154158 
    155159  /// --- pseudo actions --- 
     
    279283}; 
    280284 
     285struct ARCHIVE_VERSIONS_ACTION { 
     286  SSNAME  name; 
     287  char    physical[10]; 
     288  char    unknown2[14]; 
     289  short archiveVersion; 
     290  char targetFile[252]; 
     291}; 
     292 
    281293struct BRANCH_FILE_ACTION { 
    282294  SSNAME  name; 
     
    289301  char physical[10]; 
    290302  short dummy; 
    291   char filename[266]; 
     303  char filename[264]; 
     304} ARCHIVE_ACTION; 
     305 
     306typedef struct { 
     307  SSNAME name; 
     308  char physical[10]; 
     309  short dummy; 
     310  char filename[264]; 
    292311} RESTORE_ACTION; 
    293312 
  • trunk/ssphys/SSPhysLib/SSVersionObject.cpp

    r211 r247  
    301301  else if (pVersion->actionID == RollBack) 
    302302    return new SSRollbackAction (pRecord); 
    303   else if (pVersion->actionID == Restore) 
    304     return new SSRestoreAction (pRecord); 
     303  else if (pVersion->actionID == ArchiveVersion_File) 
     304    return new SSArchivedVersionsAction (pRecord); 
     305  else if (pVersion->actionID == Archive_File) 
     306    return new SSArchiveFileAction (pRecord); 
     307  else if (pVersion->actionID == Archive_Project) 
     308    return new SSArchiveProjectAction (pRecord); 
     309  else if (pVersion->actionID == Restore_File) 
     310    return new SSRestoreFileAction (pRecord); 
     311  else if (pVersion->actionID == Restore_Project) 
     312    return new SSRestoreProjectAction (pRecord); 
    305313  else  
    306314    throw SSUnknownActionException (pVersion->actionID, pRecord); 
     
    392400SSDestroyedAction<ACTION>::SSDestroyedAction (SSRecordPtr pRecord, std::string prefix) 
    393401  : SSItemAction<ACTION, DESTROYED_ACTION> (pRecord, ""), 
    394     m_Prefix (prefix) 
     402  m_Prefix (prefix) 
    395403{ 
    396404} 
     
    597605 
    598606//--------------------------------------------------------------------------- 
    599 void SSRestoreAction::ToXml (XMLNode* pParent) const 
    600 
    601   SSItemAction<SSRestoreAction, RESTORE_ACTION>::ToXml (pParent); 
    602  
    603   XMLElement fileNameNode (pParent, "FileName", GetFileName()); 
    604 
    605  
    606 void SSRestoreAction::Dump (std::ostream& os) const 
    607 
    608   SSItemAction<SSRestoreAction, RESTORE_ACTION>::Dump (os); 
    609 
     607void SSArchivedVersionsAction::ToXml (XMLNode* pParent) const 
     608
     609  SSItemAction<SSArchivedVersionsAction, ARCHIVE_VERSIONS_ACTION>::ToXml (pParent); 
     610 
     611  XMLElement parentNode (pParent, "Archive", GetFileName()); 
     612  XMLElement versionNode (pParent, "ArchiveVersion", GetArchiveVersion()); 
     613
     614 
     615void SSArchivedVersionsAction::Dump (std::ostream& os) const 
     616
     617  SSItemAction<SSArchivedVersionsAction, ARCHIVE_VERSIONS_ACTION>::Dump (os); 
     618
     619 
     620//--------------------------------------------------------------------------- 
     621template <class ACTION> 
     622void SSArchiveAction<ACTION>::ToXml (XMLNode* pParent) const 
     623
     624  SSItemAction<ACTION, ARCHIVE_ACTION>::ToXml (pParent); 
     625 
     626  XMLElement fileNameNode (pParent, "Archive", GetFileName()); 
     627
     628 
     629template <class ACTION> 
     630void SSArchiveAction<ACTION>::Dump (std::ostream& os) const 
     631
     632  SSItemAction<ACTION, ARCHIVE_ACTION>::Dump (os); 
     633
     634 
     635//--------------------------------------------------------------------------- 
     636template <class ACTION> 
     637void SSRestoreAction<ACTION>::ToXml (XMLNode* pParent) const 
     638
     639  SSItemAction<ACTION, RESTORE_ACTION>::ToXml (pParent); 
     640 
     641  XMLElement fileNameNode (pParent, "Archive", GetFileName()); 
     642
     643 
     644template <class ACTION> 
     645void SSRestoreAction<ACTION>::Dump (std::ostream& os) const 
     646
     647  SSItemAction<ACTION, RESTORE_ACTION>::Dump (os); 
     648
  • trunk/ssphys/SSPhysLib/SSVersionObject.h

    r192 r247  
    1313#include "SSCommentObject.h" 
    1414#include "SSName.h" 
     15#include "SSTypes.h" 
    1516//#include "SSItem.h" 
    1617 
     
    3637//class SSAction18                // missing action 18 
    3738class SSRollbackAction;           // RollBack = 19 
    38 class SSRestoreAction;            // Restore = 25 
     39class SSArchivedVersionsAction;   // Archived Versions of File 
     40class SSArchiveFileAction;        // ArchiveFile 
     41class SSArchiveProjectAction;     // ArchiveProject 
     42class SSRestoreFileAction;        // RestoreFile 
     43class SSRestoreProjectAction;     // RestoreProject 
    3944   
    4045class ISSActionVisitor 
     
    5257  virtual bool Apply (const SSBranchFileAction& rAction) = 0; 
    5358  virtual bool Apply (const SSRollbackAction& rAction) = 0; 
    54   virtual bool Apply (const SSRestoreAction& rAction) = 0; 
     59  virtual bool Apply (const SSArchivedVersionsAction& rAction) = 0; 
     60  virtual bool Apply (const SSArchiveFileAction& rAction) = 0; 
     61  virtual bool Apply (const SSArchiveProjectAction& rAction) = 0; 
     62  virtual bool Apply (const SSRestoreFileAction& rAction) = 0; 
     63  virtual bool Apply (const SSRestoreProjectAction& rAction) = 0; 
    5564 
    5665  virtual bool Apply (const SSDestroyedProjectAction& rAction) = 0; 
     
    315324}; 
    316325 
    317  
    318 //--------------------------------------------------------------------------- 
    319 class SSRestoreAction : public SSItemAction<SSRestoreAction, RESTORE_ACTION> 
    320 
    321 public: 
    322   SSRestoreAction (SSRecordPtr pRecord) 
    323     : SSItemAction<SSRestoreAction, RESTORE_ACTION> (pRecord, "Restore ") 
    324   { 
     326//--------------------------------------------------------------------------- 
     327class SSArchivedVersionsAction : public SSItemAction<SSArchivedVersionsAction, ARCHIVE_VERSIONS_ACTION> 
     328
     329public: 
     330  SSArchivedVersionsAction (SSRecordPtr pRecord) 
     331    : SSItemAction<SSArchivedVersionsAction, ARCHIVE_VERSIONS_ACTION> (pRecord, "Archived versions of ") 
     332  { 
     333  } 
     334 
     335  std::string GetFileName ()  const { return std::string (m_Action.targetFile); } 
     336  short GetArchiveVersion ()  const { return m_Action.archiveVersion; } 
     337 
     338  virtual void ToXml (XMLNode* pParent) const; 
     339  virtual void Dump (std::ostream& os) const; 
     340}; 
     341 
     342//--------------------------------------------------------------------------- 
     343template <class ACTION> 
     344class SSRestoreAction : public SSItemAction<ACTION, RESTORE_ACTION> 
     345
     346public: 
     347  SSRestoreAction (SSRecordPtr pRecord, std::string prefix) 
     348    : SSItemAction<ACTION, RESTORE_ACTION> (pRecord, ""), 
     349    m_Prefix (prefix) 
     350  { 
     351  } 
     352 
     353  virtual std::string FormatActionString () 
     354  {  
     355    std::string action; 
     356    action = "Restore " + m_Prefix + SSItemAction<ACTION, RESTORE_ACTION>::GetName (); 
     357    return action;  
    325358  } 
    326359 
     
    329362  virtual void ToXml (XMLNode* pParent) const; 
    330363  virtual void Dump (std::ostream& os) const; 
    331 }; 
    332 //--------------------------------------------------------------------------- 
    333  
     364 
     365private: 
     366  std::string m_Prefix; 
     367}; 
     368 
     369class SSRestoreProjectAction : public SSRestoreAction<SSRestoreProjectAction> 
     370
     371public: 
     372  SSRestoreProjectAction (SSRecordPtr pRecord) 
     373    : SSRestoreAction<SSRestoreProjectAction> (pRecord, "$") 
     374  {} 
     375}; 
     376 
     377class SSRestoreFileAction : public SSRestoreAction<SSRestoreFileAction> 
     378
     379public: 
     380  SSRestoreFileAction (SSRecordPtr pRecord) 
     381    : SSRestoreAction<SSRestoreFileAction> (pRecord, "") 
     382  {} 
     383}; 
     384// class SSRestoreAction : public SSItemAction<SSRestoreAction, RESTORE_ACTION> 
     385// { 
     386// public: 
     387//   SSRestoreAction (SSRecordPtr pRecord) 
     388//     : SSItemAction<SSRestoreAction, RESTORE_ACTION> (pRecord, "Restore ") 
     389//   { 
     390//   } 
     391//  
     392//   std::string GetFileName ()  const { return std::string (m_Action.filename); } 
     393//  
     394//   virtual void ToXml (XMLNode* pParent) const; 
     395//   virtual void Dump (std::ostream& os) const; 
     396// }; 
     397 
     398//--------------------------------------------------------------------------- 
     399template <class ACTION> 
     400class SSArchiveAction : public SSItemAction<ACTION, ARCHIVE_ACTION> 
     401
     402public: 
     403  SSArchiveAction (SSRecordPtr pRecord, std::string prefix) 
     404    : SSItemAction<ACTION, ARCHIVE_ACTION> (pRecord, ""), 
     405     m_Prefix (prefix) 
     406  { 
     407  } 
     408 
     409  virtual std::string FormatActionString () 
     410  {  
     411    std::string action; 
     412    action = "Archive " + m_Prefix + SSItemAction<ACTION, ARCHIVE_ACTION>::GetName (); 
     413    return action;  
     414  } 
     415 
     416  std::string GetFileName ()  const { return std::string (m_Action.filename); } 
     417 
     418  virtual void ToXml (XMLNode* pParent) const; 
     419  virtual void Dump (std::ostream& os) const; 
     420 
     421private: 
     422  std::string m_Prefix; 
     423}; 
     424 
     425class SSArchiveProjectAction : public SSArchiveAction<SSArchiveProjectAction> 
     426
     427public: 
     428  SSArchiveProjectAction (SSRecordPtr pRecord) 
     429    : SSArchiveAction<SSArchiveProjectAction> (pRecord, "$") 
     430  {} 
     431}; 
     432 
     433class SSArchiveFileAction : public SSArchiveAction<SSArchiveFileAction> 
     434
     435public: 
     436  SSArchiveFileAction (SSRecordPtr pRecord) 
     437    : SSArchiveAction<SSArchiveFileAction> (pRecord, "") 
     438  {} 
     439}; 
     440 
     441//--------------------------------------------------------------------------- 
    334442template <class ACTION> 
    335443class SSDestroyedAction : public SSItemAction<ACTION, DESTROYED_ACTION> 
  • trunk/ssphys/version.in

    r214 r247  
    11#define PRODUCTVER_MAJOR  0 
    2 #define PRODUCTVER_MINOR  20 
    3 #define PRODUCTVER_MICRO  5 
     2#define PRODUCTVER_MINOR  21 
     3#define PRODUCTVER_MICRO  0 
    44#define PRODUCTVER_REV    $WCREV$ 
    55#define PRODUCTVER_REVRANGE  $WCRANGE$ 

These ads are automatically generated by Google based on the content of this page. Revenue from these ads helps to pay for hosting fees of this site; however, these ads do not constitute an endorsement by PumaCode.org.