Logo Search packages:      
Sourcecode: rapidsvn version File versions  Download package

DirEntries svn::Client::list ( const char *  pathOrUrl,
svn_opt_revision_t *  revision,
bool  recurse 
) throw (ClientException)

lists entries in pathOrUrl no matter whether local or repository

Parameters:
pathOrUrl 
revision 
recurse 
Returns:
a vector of directory entries, each with a relative path (only filename)

Definition at line 49 of file client_ls.cpp.

  {
    Pool pool;

    apr_hash_t * hash;
    svn_error_t * error =
      svn_client_ls(&hash,
                    pathOrUrl,
                    revision,
                    recurse,
                    *m_context,
                    pool);

    if (error != 0)
      throw ClientException(error);

    apr_array_header_t *
    array = svn_sort__hash(
              hash, compare_items_as_paths, pool);

    DirEntries entries;

    for (int i = 0; i < array->nelts; ++i)
    {
      const char *entryname;
      svn_dirent_t *dirent;
      svn_sort__item_t *item;

      item = &APR_ARRAY_IDX(array, i, svn_sort__item_t);

      entryname = static_cast<const char *>(item->key);

      dirent = static_cast<svn_dirent_t *>
               (apr_hash_get(hash, entryname, item->klen));

      entries.push_back(DirEntry(entryname, dirent));
    }

    return entries;
  }


Generated by  Doxygen 1.6.0   Back to index