// // Uniform conversions with CssmData (1999-06-30_15:05:39 form) // CssmUniformDate::CssmUniformDate(const CSSM_DATA &inData) { const CssmData &data = CssmData::overlay(inData); if (data.length() != 19) CssmError::throwMe(CSSM_ERRCODE_UNKNOWN_FORMAT); setFromString(reinterpret_cast<const char *>(inData.Data), "%ld-%d-%d_%d:%d:%lf", 19); }
void ChapRName::setFromConsole() { if (Serial.available() > 0){ Serial.println("The current name of your ChapR is: "); char *currentName = get(); Serial.println(currentName); int index = 0; char buffer[15]; while (true){ if (Serial.available() > 0){ byte val = Serial.read(); if (val != '\r' && index != 14){ buffer[index] = val; } else { buffer[index] = '\0'; break; } index++; } } Serial.print("Your ChapR is now named: "); Serial.println(buffer); setFromString(buffer); Serial.println("Hit return to accept, or type \"cancel\" (return) to cancel"); index = 0; buffer[15]; while (true){ if (Serial.available() > 0){ byte val = Serial.read(); if (val != '\r' && index != 14){ buffer[index] = val; } else { buffer[index] = '\0'; break; } index++; } } if (strcmp(buffer, "cancel") == 0) { setFromString(currentName); Serial.print("Your ChapR is now named: "); Serial.println(currentName); } } }
virtual Status set( const BSONElement& newValueElement ) { if (!theReplSet) { return Status( ErrorCodes::BadValue, "replication is not enabled" ); } std::string prefetch = newValueElement.valuestrsafe(); return setFromString( prefetch ); }
virtual Status set(const BSONElement& newValueElement) { if (getGlobalReplicationCoordinator()->getReplicationMode() != ReplicationCoordinator::modeReplSet) { return Status(ErrorCodes::BadValue, "replication is not enabled"); } std::string prefetch = newValueElement.valuestrsafe(); return setFromString(prefetch); }
static void test_convexity(skiatest::Reporter* reporter) { static const SkPath::Convexity C = SkPath::kConcave_Convexity; static const SkPath::Convexity V = SkPath::kConvex_Convexity; SkPath path; REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); path.addCircle(0, 0, 10); REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); path.addCircle(0, 0, 10); // 2nd circle REPORTER_ASSERT(reporter, C == SkPath::ComputeConvexity(path)); path.reset(); path.addRect(0, 0, 10, 10, SkPath::kCCW_Direction); REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); path.reset(); path.addRect(0, 0, 10, 10, SkPath::kCW_Direction); REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); static const struct { const char* fPathStr; SkPath::Convexity fExpectedConvexity; } gRec[] = { { "", SkPath::kConvex_Convexity }, { "0 0", SkPath::kConvex_Convexity }, { "0 0 10 10", SkPath::kConvex_Convexity }, { "0 0 10 10 20 20 0 0 10 10", SkPath::kConcave_Convexity }, { "0 0 10 10 10 20", SkPath::kConvex_Convexity }, { "0 0 10 10 10 0", SkPath::kConvex_Convexity }, { "0 0 10 10 10 0 0 10", SkPath::kConcave_Convexity }, { "0 0 10 0 0 10 -10 -10", SkPath::kConcave_Convexity }, }; for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { SkPath path; setFromString(&path, gRec[i].fPathStr); SkPath::Convexity c = SkPath::ComputeConvexity(path); REPORTER_ASSERT(reporter, c == gRec[i].fExpectedConvexity); } }
// // Uniform conversions with CSSM_TIMESTRING (19990630150539 form) // CssmUniformDate::CssmUniformDate(const char *src) { setFromString(src, "%4ld%2d%2d%2d%2d%2lf", 14); }
Version::Version(const QString &str) : d(new VersionData()) { setFromString(str); }
void ofxSimpleGuiSliderBase<Type>::convertKeyboardInputToValue(){ setFromString(keyboardInputString); //keyboardInputString = ""; keyboardEdit = false; }
MSError::ErrorStatus MSIndexVector::Operations::setFromMSF (void *pData_, unsigned int index_, const char *pString_) const { return setFromString (pData_, index_, pString_); }
Version::Version(const QString &str) { setFromString(str); }