wok-6.x annotate rapidsvn/stuff/client_ls.cpp @ rev 23806

linld: add isoboot
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 24 16:16:52 2020 +0000 (2020-05-24)
parents
children
rev   line source
pascal@18438 1 /*
pascal@18438 2 * ====================================================================
pascal@18438 3 * Copyright (c) 2002-2012 The RapidSVN Group. All rights reserved.
pascal@18438 4 *
pascal@18438 5 * This program is free software: you can redistribute it and/or modify
pascal@18438 6 * it under the terms of the GNU General Public License as published by
pascal@18438 7 * the Free Software Foundation, either version 3 of the License, or
pascal@18438 8 * (at your option) any later version.
pascal@18438 9 *
pascal@18438 10 * This program is distributed in the hope that it will be useful,
pascal@18438 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
pascal@18438 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
pascal@18438 13 * GNU General Public License for more details.
pascal@18438 14 *
pascal@18438 15 * You should have received a copy of the GNU General Public License
pascal@18438 16 * along with this program (in the file GPL.txt.
pascal@18438 17 * If not, see <http://www.gnu.org/licenses/>.
pascal@18438 18 *
pascal@18438 19 * This software consists of voluntary contributions made by many
pascal@18438 20 * individuals. For exact contribution history, see the revision
pascal@18438 21 * history and logs, available at http://rapidsvn.tigris.org/.
pascal@18438 22 * ====================================================================
pascal@18438 23 */
pascal@18438 24 // subversion api
pascal@18438 25 #include "svn_client.h"
pascal@18438 26 #include "svn_path.h"
pascal@18438 27 #include "svn_sorts.h"
pascal@18438 28 //#include "svn_utf.h"
pascal@18438 29
pascal@18438 30 // svncpp
pascal@18438 31 #include "svncpp/client.hpp"
pascal@18438 32 #include "svncpp/dirent.hpp"
pascal@18438 33 #include "svncpp/exception.hpp"
pascal@18438 34
pascal@18438 35 static bool isEmpty(const char * str)
pascal@18438 36 {
pascal@18438 37 if (0 == str)
pascal@18438 38 return true;
pascal@18438 39 return 0 == *str;
pascal@18438 40 }
pascal@18438 41
pascal@18438 42 namespace svn
pascal@18438 43 {
pascal@18438 44 static svn_error_t*
pascal@18438 45 listEntriesFunc(void *baton, const char *path,
pascal@18438 46 const svn_dirent_t *dirent, const svn_lock_t *lock,
pascal@18438 47 const char *abs_path, apr_pool_t *pool)
pascal@18438 48 {
pascal@18438 49 if (!isEmpty(path))
pascal@18438 50 {
pascal@18438 51 DirEntries * entries = static_cast<DirEntries *>(baton);
pascal@18438 52 entries->push_back(
pascal@18438 53 DirEntry(path, const_cast<svn_dirent_t *>(dirent)));
pascal@18438 54 }
pascal@18438 55 return 0;
pascal@18438 56 }
pascal@18438 57
pascal@18438 58 DirEntries
pascal@18438 59 Client::list(const char * pathOrUrl,
pascal@18438 60 svn_opt_revision_t * revision,
pascal@18438 61 bool recurse) throw(ClientException)
pascal@18438 62 {
pascal@18438 63 Pool pool;
pascal@18438 64
pascal@18438 65 DirEntries entries;
pascal@18438 66 svn_error_t * error =
pascal@18438 67 svn_client_list2(pathOrUrl,
pascal@18438 68 revision,
pascal@18438 69 revision,
pascal@18438 70 recurse ? svn_depth_infinity : svn_depth_immediates,
pascal@18438 71 SVN_DIRENT_ALL,
pascal@18438 72 true,
pascal@18438 73 listEntriesFunc,
pascal@18438 74 &entries,
pascal@18438 75 *m_context,
pascal@18438 76 pool);
pascal@18438 77
pascal@18438 78 if (error != 0)
pascal@18438 79 throw ClientException(error);
pascal@18438 80
pascal@18438 81 return entries;
pascal@18438 82 }
pascal@18438 83 }
pascal@18438 84
pascal@18438 85 /* -----------------------------------------------------------------
pascal@18438 86 * local variables:
pascal@18438 87 * eval: (load-file "../../rapidsvn-dev.el")
pascal@18438 88 * end:
pascal@18438 89 */