sstring.h
/**
	 * Copy 'sz' bytes from buffer of color characters 'b' into this string,
	 * reversing them in the process.
	 */
Copy 'sz' bytes from buffer of color characters 'b' into this string,
reversing them in the process.
Copy ' sz ' bytes from buffer of color characters ' b ' into this string reversing them in the process .
void installReverseColors(const char* b, size_t sz) {
		resize(sz);
		if(sz == 0) return;
		size_t wordi = 0;
		size_t bpi   = 0;
		cs_[0] = 0;
		for(size_t i =sz; i > 0; i--) {
			char c = b[i-1];
			assert_in(c, "0123");
			int bp = asc2col[(int)c];
			assert_range(0, 3, bp);
			cs_[wordi] |= (bp << (bpi<<1));
			if(bpi == 15) {
				wordi++;
				cs_[wordi] = 0;
				bpi = 0;
			} else bpi++;
		}
	}
void installReverseColors ( const char * b , size_t sz ) { resize ( sz ) ; if ( sz == 0 ) return ; size_t wordi = 0 ; size_t bpi = 0 ; cs_ [ 0 ] = 0 ; for ( size_t i = sz ; i > 0 ; i -- ) { char c = b [ i - 1 ] ; assert_in ( c , " " ) ; int bp = asc2col [ ( int ) c ] ; assert_range ( 0 , 3 , bp ) ; cs_ [ wordi ] |= ( bp << ( bpi << 1 ) ) ; if ( bpi == 15 ) { wordi ++ ; cs_ [ wordi ] = 0 ; bpi = 0 ; } else bpi ++ ; } }
Copy 'sz' bytes from buffer of color characters 'b' into this string,
 reversing them in the process.
Copy ' sz ' bytes from buffer of color characters ' b ' into this string reversing them in the process .