Changeset 19626 for trunk


Ignore:
Timestamp:
09/05/19 11:31:30 (5 years ago)
Author:
tbretz
Message:
Added the possibility to use only one column in a file which is read with ReadFile
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mbase/MDirIter.cc

    r14993 r19626  
    207207        TObjArray &arr = *line.Tokenize(' ');
    208208
    209         for (int i=1; i<arr.GetEntries(); i++)
    210             rc += AddDirectory(arr[0]->GetName(), arr[i]->GetName(), -1);
     209        if (arr.GetEntries()==1)
     210        {
     211            // FIXME: Check for wildcards
     212            const TString file = arr[0]->GetName();
     213            const Ssiz_t p = file.Last('/');
     214
     215            if (p<=0)
     216                rc += AddDirectory(".", arr[0]->GetName(), 0);
     217            else
     218                rc += AddDirectory(TString(file(0, p)), file.Data()+p+1, 0);
     219        }
     220        else
     221        {
     222            for (int i=1; i<arr.GetEntries(); i++)
     223                rc += AddDirectory(arr[0]->GetName(), arr[i]->GetName(), -1);
     224        }
    211225
    212226        delete &arr;
Note: See TracChangeset for help on using the changeset viewer.