Results 1 to 4 of 4

Thread: Smartest way

  1. #1

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024

    Smartest way

    Here is what I want to do:

    Lets say for example I have 10 directories as followes:

    c:\temp
    c:\temp\sub1
    c:\temp\sub2
    c:\temp\sub3
    c:\temp\sub1\node1
    c:\temp\sub1\node2
    c:\temp\sub2\node1
    c:\temp\sub2\node2
    c:\temp\sub2\node3
    c:\temp\sub2\node4

    I want to keep track of which directories have files or not, if they do how many, and do they have certian types of files.

    So lets say c:\temp\sub2\node3 has main.cpp file in. When a user chooses that file which will be in a list, my program can quickly look up which directory its in.

    Whats the smartest/quickest way to do this? Class, Linked List/Vector, Map, Other?

    Thanks for your suggestions
    Last edited by Technocrat; Jun 27th, 2003 at 10:07 AM.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    map sounds good to me, depending on what you want to do (I didn't wholly get your explanation).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Huh!? What happened to my title?

    I basically want to keep track of directories and what's in them. Then list what's been found so users can pick from that list and retrieve the coresponding directory.

    I know it sounds a bit vauge, but I am not 100% sure on how the finished product is going to work, so this is the best I got.

    I was thinking map, I just want to get suggestions

    [EDIT] - Why was it posted twice!? Silly vbforums!
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    So do you want to map directory names to the contained files or short filenames to their containing directories?

    1) map<string, vector<string> >
    Fear the compiler warning

    2) multimap<string, string> (short filenames might not be unique)
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width