Esempio n. 1
0
 /**
  * Directly changes this record's internal location string. The format of this string is
  * unspecified in general and is determined by the associated IIndexLocationConverter. This method
  * should not be called on PDOMFile objects that are referenced by the file index.
  *
  * @param internalLocation
  * @throws CoreException
  */
 public void setInternalLocation(String internalLocation) throws CoreException {
   Database db = fLinkage.getDB();
   long oldRecord = db.getRecPtr(record + LOCATION_REPRESENTATION);
   if (oldRecord != 0) db.getString(oldRecord).delete();
   db.putRecPtr(record + LOCATION_REPRESENTATION, db.newString(internalLocation).getRecord());
   location = null;
 }
Esempio n. 2
0
 @Override
 public void setReplacementHeader(String replacementHeader) throws CoreException {
   Database db = fLinkage.getDB();
   long oldRecord = db.getRecPtr(record + REPLACEMENT_HEADER);
   if (oldRecord != 0) db.getString(oldRecord).delete();
   long newRecord = replacementHeader == null ? 0 : db.newString(replacementHeader).getRecord();
   db.putRecPtr(record + REPLACEMENT_HEADER, newRecord);
 }
Esempio n. 3
0
 public PDOMFile(
     PDOMLinkage linkage, IIndexFileLocation location, int linkageID, ISignificantMacros macros)
     throws CoreException {
   fLinkage = linkage;
   this.location = location;
   Database db = fLinkage.getDB();
   record = db.malloc(RECORD_SIZE);
   String locationString = fLinkage.getPDOM().getLocationConverter().toInternalFormat(location);
   if (locationString == null)
     throw new CoreException(
         CCorePlugin.createStatus(
             Messages.getString("PDOMFile.toInternalProblem") + location.getURI())); // $NON-NLS-1$
   IString locationDBString = db.newString(locationString);
   db.putRecPtr(record + LOCATION_REPRESENTATION, locationDBString.getRecord());
   db.put3ByteUnsignedInt(record + LINKAGE_ID, linkageID);
   db.putRecPtr(record + SIGNIFICANT_MACROS, db.newString(macros.encode()).getRecord());
   setTimestamp(-1);
 }