Logo Search packages:      
Sourcecode: sam2p version File versions

SimBuffer::B & SimBuffer::B::appendDump ( const Flat other,
bool  dq = false 
)

Name: Quote::NonPathOctal; from quote.rb Input: any binary Output: non-path characters converted to octal Description: Converts non-path characters ([^-_./a-zA-Z0-9]) in a string to their prebackslashed, 3-digit octal representation (i.e ). Compatibility: Ruby, ANSI C, K&R C, C++, Java (without ....), TCL double quotes (without ....), TCL unquoted strings (without ....), Perl5, Pike, AWK, PostScript Level 1, bc. See also Quote::*Octal. Valid input type: binary Valid input: any binary On invalid input: impossible Inverse of valid: lossy: Quote::UnSlash Validity indicator: implemented Output type: [-\._/a-zA-Z0-9]* Direction: encode Method: each_byte Dependencies: -

Definition at line 902 of file gensi.cpp.

References SimBuffer::Flat::beg, SimBuffer::Flat::len, and vi_grow2().

                                                                      {
  slen_t rlen=dq?2:0;
  register char c; register char const*p;
  char const *pend; char *dst;
  for (p=other.beg,pend=p+other.len; p!=pend; p++) rlen+=is_path(*p)?1:4;
  vi_grow2(0, rlen, 0, &dst);
  if (dq) *dst++='"';
  for (p=other.beg,pend=p+other.len; p!=pend; p++) {
    if (is_path(c=*p)) {
      *dst++=c;
    } else {
      *dst++='\\';
      *dst++=('0'+((c>>6)&3));
      *dst++=('0'+((c>>3)&7));
      *dst++=('0'+(c&7));
    }
  }
  if (dq) *dst++='"';
  assert(dst==end_());
  return*this;
}


Generated by  Doxygen 1.6.0   Back to index