コード例 #1
0
ファイル: End.cpp プロジェクト: Recmo/EntropyCoder
End::End(End::State _state, uint64_t _ending) throw(invalid_state)
: ending{_ending}
, state{_state}
{
	if(state == sS && ending >= msb) {
		throw invalid_state("Invalid state.");
	}
}
コード例 #2
0
ファイル: doc.c プロジェクト: kenny-thomas/xemacs
Lisp_Object
read_doc_string (Lisp_Object filepos)
{
  Lisp_Object string = get_doc_string (filepos);

  if (!STRINGP (string))
    invalid_state ("loading bytecode failed to return string", string);
  return Fread (string);
}
コード例 #3
0
ファイル: End.cpp プロジェクト: Recmo/EntropyCoder
End::End(End::State _state) throw(invalid_state)
: state{_state}
{
	if(state == sS) {
		ending = 0;
	} else if(state == s0) {
		ending = 0;
	} else if(state == s1) {
		ending = msb;
	} else {
		throw invalid_state("Invalid state.");
	}
}
コード例 #4
0
ファイル: update.cpp プロジェクト: amireh/karazeh_v2
  void update_operation::rollback() {
    // make sure the basis still exists in cache
    if (patched_) {

      if (!fs::exists(patched_path_)) {
        throw invalid_state("Basis no longer exists in cache, can not rollback!");
      }

      // the file should be there.. but just in case
      if (fs::exists(basis_path_)) {
        fs::remove(basis_path_);
      }

      fs::rename(patched_path_, basis_path_);
    }

    cleanup();
  }