public PropertyDatabaseView(PropertyDatabase propertyDatabase, PropertyDatabaseVolatileMemoryStore volatileMemoryStore, PropertyDatabaseMemoryStore memoryStore, PropertyDatabaseFileStore fileStore, PropertyStringTable stringTable, bool delayedSync) { m_PropertyDatabase = propertyDatabase; m_MemoryStore = memoryStore; m_FileStore = fileStore; m_VolatileMemoryStoreView = (PropertyDatabaseVolatileMemoryStoreView)volatileMemoryStore.GetView(); m_MemoryStoreView = (PropertyDatabaseMemoryStoreView)memoryStore.GetView(); m_FileStoreView = (PropertyDatabaseFileStoreView)fileStore.GetView(); m_StringTableView = stringTable.GetView(delayedSync); m_Disposed = false; m_DelayedSync = delayedSync; }
static void GetStringTableInfo(PropertyStringTable st, StringBuilder sb) { var longestStringsCount = 5; using (var view = st.GetView()) { sb.AppendLine($"\tString Table: {st.filePath}"); sb.AppendLine($"\t\tVersion: {view.version}"); sb.AppendLine($"\t\tCount: {view.count}"); sb.AppendLine($"\t\tSymbols slots: {view.symbolSlots}"); sb.AppendLine($"\t\tAllocated bytes for strings: {Utils.FormatBytes(view.allocatedStringBytes)}"); sb.AppendLine($"\t\tUsed bytes for strings: {Utils.FormatBytes(view.usedStringBytes)}"); sb.AppendLine($"\t\tAverage byte size for strings: {Utils.FormatBytes(view.GetAverageBytesPerString())}"); sb.AppendLine($"\t\tFile size: {Utils.FormatBytes(view.fileSize)}"); sb.AppendLine($"\t\tTop {longestStringsCount} longest strings:"); var strings = view.GetAllStrings(); foreach (var str in strings.OrderByDescending(s => s.Length).Take(longestStringsCount)) { sb.AppendLine($"\t\t\t{str}"); } } }
public PropertyDatabaseRecordValue CreateRecordValue(object value) { using (var view = m_StringTable.GetView()) return(CreateRecordValue(value, view)); }