From 4d495175043c399fdca6e1bb4c74ef176fc76fb4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 6 Aug 2025 11:29:57 +0900 Subject: Replace TRUE/FALSE with boolean values true/false - part 4 Signed-off-by: Michele Calgaro --- doc/html/tqcache.html | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'doc/html/tqcache.html') diff --git a/doc/html/tqcache.html b/doc/html/tqcache.html index c7f046f0d..fd4baf5be 100644 --- a/doc/html/tqcache.html +++ b/doc/html/tqcache.html @@ -37,7 +37,7 @@ body { background: #ffffff; color: black; }

List of all member functions.

Public Members

@@ -78,7 +78,7 @@ operates on pointers to X, or X*. item, returns it, and by default marks it as being the most recently used item.

There are also methods to remove() or take() an object from the -cache. Calling setAutoDelete(TRUE) for a cache tells it to delete +cache. Calling setAutoDelete(true) for a cache tells it to delete items that are removed. The default is to not delete items when they are removed (i.e., remove() and take() are equivalent).

When inserting an item into the cache, only the pointer is copied, @@ -99,7 +99,7 @@ same performance as a TQAsciiCache.

See also TQCacheIterator, TQAsciiCache, TQIntCache, Collection Classes, and Non-GUI Classes.


Member Function Documentation

-

TQCache::TQCache ( int maxCost = 100, int size = 17, bool caseSensitive = TRUE ) +

TQCache::TQCache ( int maxCost = 100, int size = 17, bool caseSensitive = true )

Constructs a cache whose contents will never have a total cost @@ -112,8 +112,8 @@ than the largest expected number of items in the cache. item, if the total cost of all items in the cache will exceed maxCost, the cache will start throwing out the older (least recently used) items until there is enough room for the new item to be inserted. -

If caseSensitive is TRUE (the default), the cache keys are case -sensitive; if it is FALSE, they are case-insensitive. +

If caseSensitive is true (the default), the cache keys are case +sensitive; if it is false, they are case-insensitive. Case-insensitive comparison considers all Unicode letters.

TQCache::~TQCache () @@ -125,7 +125,7 @@ that access this cache will be reset.

bool TQPtrCollection::autoDelete () const

-

Returns the setting of the auto-delete option. The default is FALSE. +

Returns the setting of the auto-delete option. The default is false.

See also setAutoDelete().

void TQCache::clear () [virtual] @@ -144,11 +144,11 @@ has been enabled.

See also totalCost().

Reimplemented from TQPtrCollection. -

type * TQCache::find ( const TQString & k, bool ref = TRUE ) const +

type * TQCache::find ( const TQString & k, bool ref = true ) const

Returns the item associated with key k, or 0 if the key does -not exist in the cache. If ref is TRUE (the default), the item +not exist in the cache. If ref is true (the default), the item is moved to the front of the least recently used list.

If there are two or more items with equal keys, the one that was inserted last is returned. @@ -157,14 +157,14 @@ inserted last is returned.

Inserts the item d into the cache with key k and associated -cost, c. Returns TRUE if it is successfully inserted; otherwise -returns FALSE. +cost, c. Returns true if it is successfully inserted; otherwise +returns false.

The cache's size is limited, and if the total cost is too high, TQCache will remove old, least recently used items until there is room for this new item.

The parameter p is internal and should be left at the default value (0). -

Warning: If this function returns FALSE (which could happen, e.g. +

Warning: If this function returns false (which could happen, e.g. if the cost of this item alone exceeds maxCost()) you must delete d yourself. Additionally, be very careful about using d after calling this function because any other insertions into the @@ -175,7 +175,7 @@ become invalid.

bool TQCache::isEmpty () const

-

Returns TRUE if the cache is empty; otherwise returns FALSE. +

Returns true if the cache is empty; otherwise returns false.

int TQCache::maxCost () const

@@ -191,16 +191,16 @@ exist in the cache, and moves the item to the front of the least recently used list.

If there are two or more items with equal keys, the one that was inserted last is returned. -

This is the same as find( k, TRUE ). +

This is the same as find( k, true ).

See also find().

bool TQCache::remove ( const TQString & k )

-

Removes the item associated with k, and returns TRUE if the -item was present in the cache; otherwise returns FALSE. +

Removes the item associated with k, and returns true if the +item was present in the cache; otherwise returns false.

The item is deleted if auto-deletion has been enabled, i.e., if -you have called setAutoDelete(TRUE). +you have called setAutoDelete(true).

If there are two or more items with equal keys, the one that was inserted last is removed.

All iterators that refer to the removed item are set to point to @@ -211,11 +211,11 @@ the next item in the cache's traversal order.

Sets the collection to auto-delete its contents if enable is -TRUE and to never delete them if enable is FALSE. +true and to never delete them if enable is false.

If auto-deleting is turned on, all the items in a collection are deleted when the collection itself is deleted. This is convenient if the collection has the only pointer to the items. -

The default setting is FALSE, for safety. If you turn it on, be +

The default setting is false, for safety. If you turn it on, be careful about copying the collection - you might find yourself with two collections deleting the same items.

Note that the auto-delete setting may also affect other functions -- cgit v1.2.3