2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $TOG: UAS_BookcaseEntry.C /main/5 1998/04/17 11:40:44 mgreess $
24 #include "UAS_BookcaseEntry.hh"
29 UASbasename(const char *path)
36 for (p = path + strlen(path) - 1; *p != '/' && p != path; p--);
45 // /////////////////////////////////////////////////////////////////
46 // UAS_BookcaseEntry - ctor, dtor
47 // /////////////////////////////////////////////////////////////////
49 UAS_BookcaseEntry::UAS_BookcaseEntry(UAS_Pointer<UAS_Common> &bookcase,
51 : f_searchable(searchable),
55 const char *bc_path = bookcase->id();
57 f_name = f_path = NULL;
61 const char *bc_name = UASbasename(bc_path);
63 f_name = new char[strlen(bc_name)+1];
64 strcpy(f_name, bc_name);
66 f_path = new char[strlen(bc_path)+1];
67 strcpy (f_path, bc_path);
70 f_infolib_id = bookcase->lid();
71 f_bookcase_id = bookcase->bid();
74 UAS_BookcaseEntry::~UAS_BookcaseEntry()
76 if (f_name) delete f_name;
77 if (f_path) delete f_path;
82 UAS_BookcaseEntry::set_book_list (UAS_ObjList<int> &list)
84 f_book_list = list; // replace it