コード例 #1
0
ファイル: optanonymizer.c プロジェクト: lazopard/CS240
int main() {
	char message[MAXLENGTH];
	int i,count,j = 0;
	char c;
	while (( (c = getchar()) != EOF) && count < MAXLENGTH) {
		message[count++] = c;
	}
	for(i=0; i < count;i++) {
		if (message[i] == '@' && is_alpha_numeric(message[i+1])) 
			j = i - 1 ;
			while (is_alpha_numeric(message[j]))
					message[j--] = 'X';
	}
	for(i = 0;i < MAXLENGTH;i++)
		putchar(message[i]);
	putchar('\n');
}
コード例 #2
0
j_dbl read_double_and_advance(J_UI_String::const_iterator* i_string_pos, int i_max_len){
	auto string_pos = *i_string_pos;
	auto end_pos = *i_string_pos + i_max_len;
	assert(0);
	string new_string;
	while(string_pos != end_pos){
	
		if(string_pos->is_alpha_numeric() || ('.' == string_pos->charcode())){
			continue;
		}

	}
	char* end_char_pos;
	Dbl_t return_val = strtod(new_string.c_str(), &end_char_pos);
	*i_string_pos += safe_int_cast(end_char_pos - &new_string[0]);
	
	return return_val;
}
コード例 #3
0
ファイル: URI.cpp プロジェクト: kurocha/dream
				//   scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
				static bool is_scheme_character(IteratorT i) {
					return is_alpha_numeric(i) || *i == '+' || *i == '-' || *i == '.';
				}
コード例 #4
0
ファイル: URI.cpp プロジェクト: kurocha/dream
				//   unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
				static bool is_unreserved(IteratorT i) {
					return is_alpha_numeric(i) || *i == '-' || *i == '.' || *i == '_' || *i == '~';
				}
コード例 #5
0
ファイル: text_entry.cpp プロジェクト: jseward/solar
	bool text_entry::on_key_down(const window_key_event_params& params) {
		bool is_trapped = false;

		if (is_focused()) {
			//don't trap when ALT is down, this would prevent ALT-TAB
			if (!params.is_alt_down()) {
				is_trapped = true;

				if (params.is_ctrl_down()) {
					if (params.is_shift_down()) {
						if (params._key == keyboard_key::LEFT) {
							move_caret_left_to_next_word(params.is_shift_down());
						}
						else if (params._key == keyboard_key::RIGHT) {
							move_caret_right_to_next_word(params.is_shift_down());
						}
						else {
							is_trapped = false;
						}
					}
					else {
						if (params._key == keyboard_key::C) {
							copy_text_to_clipboard(params._clipboard);
						}
						else if (params._key == keyboard_key::X) {
							cut_text_to_clipboard(params._clipboard);
						}
						else if (params._key == keyboard_key::V) {
							paste_text_from_clipboard(params._clipboard);
						}
						else {
							is_trapped = false;
						}
					}
				}
				else {
					if (params._key == keyboard_key::BACKSPACE) {
						handle_backspace_key_down();
					}
					else if (params._key == keyboard_key::DEL) {
						handle_delete_key_down();
					}
					else if (params._key == keyboard_key::HOME) {
						move_caret_home(params.is_shift_down());
					}
					else if (params._key == keyboard_key::END) {
						move_caret_end(params.is_shift_down());
					}
					else if (params._key == keyboard_key::LEFT) {
						move_caret_left(1, params.is_shift_down());
					}
					else if (params._key == keyboard_key::RIGHT) {
						move_caret_right(1, params.is_shift_down());
					}
					else if (params._key == keyboard_key::ENTER) {
						if (_should_trap_enter) {
							try_apply_changes();
							move_caret_end(false);
						}
						else {
							is_trapped = false;
						}
					}
					else {
						//NOTE: trap all keys, needs to by symmetrical with on_char_received(). Alphanumeric keys
						//where being picked up by other windows even though on_char_received() was trapping the event.
						is_trapped = is_alpha_numeric(params._key) || (params._key == keyboard_key::SPACE);
					}
				}
			}
		}

		return is_trapped;
	}