<commit_before>//
// Copyright (C) 2004, 2005 Pingtel Corp.
// 
//
// $$
////////////////////////////////////////////////////////////////////////
//////


// SYSTEM INCLUDES

#include <string.h>
#include <ctype.h>
#include <stdio.h>

// APPLICATION INCLUDES
#include "net/NameValuePair.h"

// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STATIC VARIABLE INITIALIZATIONS
int NameValuePair::count = 0;
OsMutex   NameValuePair::mCountLock(OsMutex::Q_PRIORITY);

int getNVCount()
{
        return NameValuePair::count;
}
/* //////////////////////////// PUBLIC //////////////////////////////////// */

/* ============================ CREATORS ================================== */

// Constructor
NameValuePair::NameValuePair(const char* name, const char* value) :
        UtlString(name)
{
   valueString = NULL;
   setValue(value);

#ifdef TEST_ACCOUNT
        mCountLock.acquire();
   count++;
        mCountLock.release();
#endif
}

// Copy constructor
NameValuePair::NameValuePair(const NameValuePair& rNameValuePair) :
UtlString(rNameValuePair)
{
    // Slow copy does implicit const./dest of UtlString
    //((UtlString) *this) = rNameValuePair;

    // Use parent copy constructor
    this->UtlString::operator=(rNameValuePair);

    valueString = NULL;
    setValue(rNameValuePair.valueString);
}

// Destructor
NameValuePair::~NameValuePair()
{
   if(valueString)
   {
                delete[] valueString;
                valueString = 0;
   }

#ifdef TEST_ACCOUNT
        mCountLock.acquire();
   count--;
        mCountLock.release();
#endif
}

/* ============================ MANIPULATORS ============================== */

// Assignment operator
NameValuePair&
NameValuePair::operator=(const NameValuePair& rhs)
{
   if (this == &rhs)            // handle the assignment to self case
      return *this;

   ((UtlString) *this) = rhs.data();
   setValue(rhs.valueString);

   return *this;
}

/* ============================ ACCESSORS ================================= */
const char* NameValuePair::getValue()
{
        return(valueString);
}<commit_msg>Casts of lvalues need to use reference types. http://track.sipfoundry.org/browse/XSL-120<commit_after>//
// Copyright (C) 2004, 2005 Pingtel Corp.
// 
//
// $$
////////////////////////////////////////////////////////////////////////
//////


// SYSTEM INCLUDES

#include <string.h>
#include <ctype.h>
#include <stdio.h>

// APPLICATION INCLUDES
#include "net/NameValuePair.h"

// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STATIC VARIABLE INITIALIZATIONS
int NameValuePair::count = 0;
OsMutex   NameValuePair::mCountLock(OsMutex::Q_PRIORITY);

int getNVCount()
{
        return NameValuePair::count;
}
/* //////////////////////////// PUBLIC //////////////////////////////////// */

/* ============================ CREATORS ================================== */

// Constructor
NameValuePair::NameValuePair(const char* name, const char* value) :
        UtlString(name)
{
   valueString = NULL;
   setValue(value);

#ifdef TEST_ACCOUNT
        mCountLock.acquire();
   count++;
        mCountLock.release();
#endif
}

// Copy constructor
NameValuePair::NameValuePair(const NameValuePair& rNameValuePair) :
UtlString(rNameValuePair)
{
    // Slow copy does implicit const./dest of UtlString
    //((UtlString) *this) = rNameValuePair;

    // Use parent copy constructor
    this->UtlString::operator=(rNameValuePair);

    valueString = NULL;
    setValue(rNameValuePair.valueString);
}

// Destructor
NameValuePair::~NameValuePair()
{
   if(valueString)
   {
                delete[] valueString;
                valueString = 0;
   }

#ifdef TEST_ACCOUNT
        mCountLock.acquire();
   count--;
        mCountLock.release();
#endif
}

/* ============================ MANIPULATORS ============================== */

// Assignment operator
NameValuePair&
NameValuePair::operator=(const NameValuePair& rhs)
{
   if (this == &rhs)            // handle the assignment to self case
      return *this;

   ((UtlString&) *this) = rhs.data();
   setValue(rhs.valueString);

   return *this;
}

/* ============================ ACCESSORS ================================= */
const char* NameValuePair::getValue()
{
        return(valueString);
}
{'fraction_non_alphanumeric': 0.26490066225165565, 'fraction_numerical': 0.005439924314096499, 'mean_word_length': 2.6614718614718615, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1994230', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1228, 'n_words': 250}