| 1552 | } |
| 1553 | |
| 1554 | bool tinyNodeCollection::createCacheFile() |
| 1555 | { |
| 1556 | if ( _cacheFile ) |
| 1557 | return true; |
| 1558 | CacheFile * f = new CacheFile(); |
| 1559 | //lString16 cacheFileName("/tmp/cr3swap.tmp"); |
| 1560 | |
| 1561 | lString16 fname = getProps()->getStringDef( DOC_PROP_FILE_NAME, "noname" ); |
| 1562 | lUInt32 sz = (lUInt32)getProps()->getInt64Def(DOC_PROP_FILE_SIZE, 0); |
| 1563 | lUInt32 crc = getProps()->getIntDef(DOC_PROP_FILE_CRC32, 0); |
| 1564 | |
| 1565 | if ( !ldomDocCache::enabled() ) { |
| 1566 | CRLog::error("Cannot swap: cache dir is not initialized"); |
| 1567 | return false; |
| 1568 | } |
| 1569 | |
| 1570 | CRLog::info("ldomDocument::createCacheFile() - initialized swapping of document %s to cache file", UnicodeToUtf8(fname).c_str() ); |
| 1571 | |
| 1572 | LVStreamRef map = ldomDocCache::createNew( fname, crc, getPersistenceFlags(), sz ); |
| 1573 | if ( map.isNull() ) { |
| 1574 | delete f; |
| 1575 | return false; |
| 1576 | } |
| 1577 | |
| 1578 | if ( !f->create( map ) ) { |
| 1579 | delete f; |
| 1580 | return false; |
| 1581 | } |
| 1582 | _cacheFile = f; |
| 1583 | _mapped = true; |
| 1584 | _textStorage.setCache( f ); |
| 1585 | _elemStorage.setCache( f ); |
| 1586 | _rectStorage.setCache( f ); |
| 1587 | _styleStorage.setCache( f ); |
| 1588 | _blobCache.setCacheFile( f ); |
| 1589 | return true; |
| 1590 | } |
| 1591 | |
| 1592 | void tinyNodeCollection::clearNodeStyle( lUInt32 dataIndex ) |
| 1593 | { |
no test coverage detected