/[RomCheater]/trunk/RomCheater/Serialization/SearchResultWriter.cs
ViewVC logotype

Diff of /trunk/RomCheater/Serialization/SearchResultWriter.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 456 by william, Mon Jun 3 01:45:40 2013 UTC revision 578 by william, Thu Jun 6 08:18:44 2013 UTC
# Line 1  Line 1 
1  ´╗┐using System;  ´╗┐#region Logging Defines
2    // include this any class or method that required logging, and comment-out what is not needed
3    
4    #region Enabled logging levels
5    #define LOGGING_ENABLE_INFO
6    #define LOGGING_ENABLE_WARN
7    #define LOGGING_ENABLE_DEBUG
8    #define LOGGING_ENABLE_VERBOSEDEBUG
9    #define LOGGING_ENABLE_ERROR
10    #define LOGGING_ENABLE_VERBOSEERROR
11    #define LOGGING_ENABLE_PROFILER
12    #endregion
13    #endregion
14    using System;
15  using System.Collections.Generic;  using System.Collections.Generic;
16  using System.Linq;  using System.Linq;
17  using System.Text;  using System.Text;
# Line 9  namespace RomCheater.Serialization Line 22  namespace RomCheater.Serialization
22  {  {
23      public interface ISearchResultWriter      public interface ISearchResultWriter
24      {      {
25          void WriteResult<TValue>(uint address, TValue value) where TValue : IConvertible;          void WriteResult<TValue>(ulong address, TValue value) where TValue : IConvertible;
26      }      }
27      public class SearchResultWriter : SerializationWriter, ISearchResultWriter      public class SearchResultWriter : SerializationWriter, ISearchResultWriter
28      {      {
29    
30          private int ResultsWritten = 0;          private ulong ResultsWritten = 0;
31          protected override string TemporaryFolder { get { return SearchResultsConstants.SearchResultsFolder; } }          protected override string TemporaryFolder { get { return SearchResultsConstants.SearchResultsFolder; } }
32          //public SearchResultWriter() : base() { }          //public SearchResultWriter() : base() { }
33          public SearchResultWriter(int resultCount, Guid guid) : base(resultCount, guid) { WriteHeader(guid); }          public SearchResultWriter(Guid guid) : this(0, guid) { }
34            public SearchResultWriter(Guid guid, bool delete) : this(0, guid, delete) { }
35            public SearchResultWriter(ulong resultCount, Guid guid) : this(resultCount, guid, false) { }
36            public SearchResultWriter(ulong resultCount, Guid guid, bool delete) : base(resultCount, guid, delete) { WriteHeader(guid); }
37          //public SearchResultWriter(string filename, Guid guid) : base(CreateFileName(filename,guid), guid) { WriteHeader(guid); }          //public SearchResultWriter(string filename, Guid guid) : base(CreateFileName(filename,guid), guid) { WriteHeader(guid); }
38          //public SearchResultWriter(string filename, int resultCount, Guid guid) : base(filename, resultCount, guid, false) { WriteHeader(guid); }          //public SearchResultWriter(string filename, int resultCount, Guid guid) : base(filename, resultCount, guid, false) { WriteHeader(guid); }
39          //public SearchResultWriter(string filename, int resultCount, Guid guid, bool delete) : base(filename, resultCount, guid, delete) { WriteHeader(guid); }                //public SearchResultWriter(string filename, int resultCount, Guid guid, bool delete) : base(filename, resultCount, guid, delete) { WriteHeader(guid); }      
40          #region ISearchResultWriter members          #region ISearchResultWriter members
41          public void WriteResult<TValue>(uint address, TValue value) where TValue : IConvertible          public void WriteResult<TValue>(ulong address, TValue value) where TValue : IConvertible
42          {          {
43              try              try
44              {              {
# Line 87  namespace RomCheater.Serialization Line 103  namespace RomCheater.Serialization
103                  }                  }
104                  // write count (int)                  // write count (int)
105                  binWriter.Write(ResultCount);                  binWriter.Write(ResultCount);
106                  ResultCountOffset = binWriter.BaseStream.Position - sizeof(int);                  ResultCountOffset = binWriter.BaseStream.Position - sizeof(ulong);
107              }              }
108              catch (Exception ex)              catch (Exception ex)
109              {              {
# Line 122  namespace RomCheater.Serialization Line 138  namespace RomCheater.Serialization
138              }              }
139          }          }
140      }      }
141  }  }

Legend:
Removed from v.456  
changed lines
  Added in v.578

  ViewVC Help
Powered by ViewVC 1.1.22