~kinkie/squid/stringng

« back to all changes in this revision

Viewing changes to src/SBuf.cc

  • Committer: Francesco Chemolli
  • Date: 2011-04-27 15:00:38 UTC
  • Revision ID: kinkie@squid-cache.org-20110427150038-kp2qdna80hrv236p
Steamlined SBuf::rawSpace and implemented its companion SBuf::forceSize() method.
Clarified documentation.
Implemented size argument to cow()

Show diffs side-by-side

added added

removed removed

Lines of Context:
480
480
char *
481
481
SBuf::rawSpace(size_type minsize)
482
482
{
483
 
    if (minsize==npos)
484
 
        minsize=store_->capacity-length();
485
 
    reserve(minsize);
 
483
    cow(minsize); //passing default npos is handled by cow
486
484
    ++stats.rawAccess;
487
485
    return bufEnd();
488
486
}
489
487
 
 
488
void
 
489
SBuf::forceSize(SBuf::size_type newsize)
 
490
{
 
491
    Must(store_->RefCountCount() == 1);
 
492
    len_=newsize;
 
493
    store_->size=newsize;
 
494
}
 
495
 
490
496
const char*
491
497
SBuf::c_str()
492
498
{
795
801
    ++stats.copyOut;
796
802
    return rv;
797
803
}
 
804
 
798
805
#if !_USE_INLINE_
799
806
#include "SBuf.cci"
800
807
#endif