<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to InsertString Method</title><link>https://sourceforge.net/p/perfcache/wiki/InsertString%2520Method/</link><description>Recent changes to InsertString Method</description><atom:link href="https://sourceforge.net/p/perfcache/wiki/InsertString%20Method/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 14 Dec 2011 20:06:31 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/perfcache/wiki/InsertString%20Method/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage InsertString Method modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/InsertString%2520Method/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Wed, 14 Dec 2011 20:06:31 -0000</pubDate><guid>https://sourceforge.net8b35563f331ea9cdeb5a04f746e7b8b55d5376af</guid></item><item><title>WikiPage InsertString modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/InsertString/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,53 +1,50 @@
-##### Method: Cache::Insert #####
-
+##### Method: Cache::InsertString #####
+
 ###### Summary: ######
 
 InsertString() inserts a byte or character string, including the trailing NULL, into a cache entry within the cache. InsertString() has two overloads, differing by key type; however both overloads for this method insert a string of bytes, or single-byte characters, not wide characters, into the cache.
 
 &lt;br /&gt;
 ###### Syntax: ######
 
     int InsertString (const QBYTE *szKey, 
                       const QBYTE *pbszData,
                       const unsigned int numSecondsTTL);
 
     int InsertString (const QWORD *wszKey, 
                       const QBYTE *pbszData,
                       const unsigned int numSecondsTTL);
 
 &lt;br /&gt;
 ###### Parameters:######
 
     1) szKey or wszKey: the key
 
     2) pbszData: a pointer to a buffer of bytes that will be inserted into the cache.
 
     3) numSecondsTTL: number of seconds for the "time-to-live" value.
 
 &lt;br /&gt;
 ###### Return values:######
 
       E_KEY_INVALIDKEYTYPE
       E_INVALID_KEYVALUE
       E_CACHE_DUPLICATE_KEY_FOUND_ENTRY_NOT_REPLACED
       E_SUCCESS
 
 &lt;br /&gt;
 ###### Remarks:######
 
 The InsertString() method inserts a key and an associated byte string value into the cache. If the cache is full, a replacement is performed; the type of replacement is dependent on the cache replacement policy.
 
 &lt;br /&gt;
 ###### Example ######
 
-    char szVal  [26 + 1];
-
-    strcpy (szVal, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
-
-    // (note: in this case, the trailing NULL is inserted)
-
-    iResult = pCache-&gt;Insert ((const QBYTE *)"Alphabet", (QBYTE *) szVal, strlen(szVal)+1, 0);
-
+    // (initialize cache here)
+
+    int iResult = pCache-&gt;InsertString ((QBYTE *) "AA",     // key
+                                        (QBYTE *) "aaaaa",  // char string value
+                                        0);                 // TTL
     if (iResult != E_SUCCESS)
     {
         // error handling here
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Wed, 14 Dec 2011 19:47:11 -0000</pubDate><guid>https://sourceforge.net6057c8c3ba00903bba2046614507491fc0052938</guid></item><item><title>WikiPage InsertString modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/InsertString/</link><description>##### Method: Cache::Insert #####

###### Summary: ######

InsertString() inserts a byte or character string, including the trailing NULL, into a cache entry within the cache. InsertString() has two overloads, differing by key type; however both overloads for this method insert a string of bytes, or single-byte characters, not wide characters, into the cache.

&lt;br /&gt;
###### Syntax: ######

    int InsertString (const QBYTE *szKey, 
                      const QBYTE *pbszData,
                      const unsigned int numSecondsTTL);

    int InsertString (const QWORD *wszKey, 
                      const QBYTE *pbszData,
                      const unsigned int numSecondsTTL);

&lt;br /&gt;
###### Parameters:######

    1) szKey or wszKey: the key

    2) pbszData: a pointer to a buffer of bytes that will be inserted into the cache.

    3) numSecondsTTL: number of seconds for the "time-to-live" value.

&lt;br /&gt;
###### Return values:######

      E_KEY_INVALIDKEYTYPE
      E_INVALID_KEYVALUE
      E_CACHE_DUPLICATE_KEY_FOUND_ENTRY_NOT_REPLACED
      E_SUCCESS

&lt;br /&gt;
###### Remarks:######

The InsertString() method inserts a key and an associated byte string value into the cache. If the cache is full, a replacement is performed; the type of replacement is dependent on the cache replacement policy.

&lt;br /&gt;
###### Example ######

    char szVal  [26 + 1];

    strcpy (szVal, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");

    // (note: in this case, the trailing NULL is inserted)

    iResult = pCache-&gt;Insert ((const QBYTE *)"Alphabet", (QBYTE *) szVal, strlen(szVal)+1, 0);

    if (iResult != E_SUCCESS)
    {
        // error handling here
    }
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Wed, 14 Dec 2011 19:43:36 -0000</pubDate><guid>https://sourceforge.nete7ddce55e8dc32e3f2baf470882034a7c8689b81</guid></item></channel></rss>