AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Stream

Ein Thema von mohfa · begonnen am 6. Jun 2007 · letzter Beitrag vom 6. Jun 2007
Antwort Antwort
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

Stream

  Alt 6. Jun 2007, 08:04
I use MxStorage to store my Files , is there a way to search for a keyword in these stored Files without extract them at all , Then if the result is positive we give the File Name where the Keyword is found.

I thought of using a Stream ( TMemorySteam ).


Thanks in advance
  Mit Zitat antworten Zitat
Benutzerbild von Phoenix
Phoenix
(Moderator)
Online

Registriert seit: 25. Jun 2002
Ort: Hausach
7.613 Beiträge
 
#2

Re: Stream

  Alt 6. Jun 2007, 08:20
I would keep a seperate hashtable with the keywords and the specific filenames. Searching in a well sorted hashtable is a lot faster than running around in a stream, because you would have to scan the whole stream (worst case) to find the keyword - in the (sorted) hashtable you only have to match up the hash value, and you can do that character for character, so when you have the hash abcdef and you start at the beginning and find baaaaa in the list you know that you don't have to look further because there won't be another hash starting with an a later on.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: Stream

  Alt 6. Jun 2007, 08:26
Thanks Phoenix , could you please provide me with an exemple .
  Mit Zitat antworten Zitat
Benutzerbild von Phoenix
Phoenix
(Moderator)
Online

Registriert seit: 25. Jun 2002
Ort: Hausach
7.613 Beiträge
 
#4

Re: Stream

  Alt 6. Jun 2007, 08:34
Huh, that was more a theoretical point of view

But I think there are good 'THashTable' implementations somewhere out there you can use.

Have a look here: http://www.vclcomponents.com/catalog/Hash_Table
and here: http://www.benya.com/code/collections/hashtable.html

I think a search for Bei Google suchenHashTable Delphi or a search here in the DP for Hier im Forum suchenHashtable will bring you good additional information.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz