Exemple #1
0
Mark_mmdb::Mark_mmdb (MarkBase_mmdb &base, UAS_Pointer<UAS_Common> &doc_ptr,
		      const Anchor &anchor,
		      const char *name, const char *notes)
: f_doc_ptr (doc_ptr),
  f_anchor (anchor),
  f_mark_base (base),
  f_name (NULL),
  f_notes (NULL)
{
  // This creates a new user mark in the mmdb mark database. 

#ifdef FUJITSU_OLIAS
  // Id = bookcase id / section id
  UAS_String theId = doc_ptr->bid();
  theId = theId + "/" + doc_ptr->id();
#else
  UAS_String theId = doc_ptr->id();
#endif
  
  f_user_mark = new mark_smart_ptr (base, theId);
  set_name (name);
  set_notes (notes);

  // Flush the new mark to disk. 
  do_save();
}
Exemple #2
0
void
MarkBase_mmdb::get_marks (UAS_Pointer<UAS_Common> &doc_ptr,
			  xList<UAS_Pointer<Mark> > &list)
{
#ifdef FUJITSU_OLIAS
  UAS_String theId = doc_ptr->bid();
  theId = theId + "/" + doc_ptr->id();
#else
  UAS_String theId = doc_ptr->id();
#endif

  oid_list_handler *l =
    f_mark_base->get_mark_list ((char *) theId);

  if (l != NULL)
    {
      for (int i = 1; i <= (*l)->count(); i++)
	{
	  // Pull the entry from the list and replace it with NULL so
	  // that it doesn't get deleted when the list is deleted.
	  oid_t id = (*l)-> operator()(i);

	  // Assure that the oid_t has not been deleted. qfc 7-6-93
          if (id.eq (oid_t (c_code_t(0), 0)) == false)
	    {
	      try
		{
		  Mark_mmdb *m = find_mark (id, doc_ptr);
		  list.append (m);
		}
	      catch_any()
		{
		  // ignore failure for now! DJB 
		}
	      end_try;
	    }
	}
      delete l;
    }
}
Exemple #3
0
UAS_BookcaseEntry::UAS_BookcaseEntry(UAS_Pointer<UAS_Common> &bookcase,
                                     int searchable) 
: f_searchable(searchable),
  f_name(0),
  f_base_num(-1)
{
    const char *bc_path = bookcase->id();
    if (! bc_path) {
	f_name = f_path = NULL;
    }
    else {

	const char *bc_name = UASbasename(bc_path);

	f_name = new char[strlen(bc_name)+1];
	strcpy(f_name, bc_name);

	f_path = new char[strlen(bc_path)+1];
	strcpy (f_path, bc_path);
    }

   f_infolib_id  = bookcase->lid();
   f_bookcase_id = bookcase->bid();
}