sstring.h
/**
	 * Copy 'sz' DNA characters from buffer 'b' into this packed string.
	 */
Copy 'sz' DNA characters from buffer 'b' into this packed string.
Copy ' sz ' DNA characters from buffer ' b ' into this packed string .
void installChars(const char* b, size_t sz) {
		if(sz == 0) return;
		resize(sz);
		size_t wordi = 0;
		for(size_t i = 0; i < sz; i += 16) {
			uint32_t word = 0;
			for(int j = 0; j < 16 && (size_t)(i+j) < sz; j++) {
				char c = b[i+j];
				assert_in(toupper(c), "ACGT");
				int bp = asc2dna[(int)c];
				assert_range(0, 3, (int)bp);
				uint32_t shift = (uint32_t)j << 1;
				word |= (bp << shift);
			}
			cs_[wordi++] = word;
		}
	}
void installChars ( const char * b , size_t sz ) { if ( sz == 0 ) return ; resize ( sz ) ; size_t wordi = 0 ; for ( size_t i = 0 ; i < sz ; i += 16 ) { uint32_t word = 0 ; for ( int j = 0 ; j < 16 && ( size_t ) ( i + j ) < sz ; j ++ ) { char c = b [ i + j ] ; assert_in ( toupper ( c ) , " " ) ; int bp = asc2dna [ ( int ) c ] ; assert_range ( 0 , 3 , ( int ) bp ) ; uint32_t shift = ( uint32_t ) j << 1 ; word |= ( bp << shift ) ; } cs_ [ wordi ++ ] = word ; } }
Copy 'sz' DNA characters from buffer 'b' into this packed string.
Copy ' sz ' DNA characters from buffer ' b ' into this packed string .