本文整理汇总了C++中outString函数的典型用法代码示例。如果您正苦于以下问题:C++ outString函数的具体用法?C++ outString怎么用?C++ outString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAt
void CGroupsInfo::printGroupInfo(FILE *file) const
{
size_t i = GetAt(0)->numMatrices() ? 0 : 1;
const size_t iMax = GetSize();
if (i == iMax)
return; // Nothing was constructed
#define SHIFT " "
char buffer[256], line[256];
size_t len = SPRINTF(buffer, "\n" SHIFT " |Aut(D)| Nd: Ns: Ndt: Nst:\n");
outString(buffer, file);
strcpy_s(line, countof(line), SHIFT);
const size_t l_Shift = strlen(SHIFT);
memset(line + l_Shift, '_', len);
len += l_Shift;
strcpy_s(line + len, countof(line) - len, "\n");
outString(line, file);
COrderInfo total(0, 0);
for (; i < iMax; i++) {
const COrderInfo *pInfo = GetAt(i);
total.addMatrix(pInfo);
len = SPRINTF(buffer, SHIFT"%10zd", pInfo->groupOrder());
pInfo->outNumbInfo(buffer, countof(buffer) - len, len);
outString(buffer, file);
}
outString(line, file);
len = SPRINTF(buffer, " Total:");
total.outNumbInfo(buffer, countof(buffer) - len, len);
outString(buffer, file);
}
示例2: setRunTime
void CEnumInfo<T>::outEnumInfo(FILE **pOutFile, bool removeReportFile, const CGroupsInfo *pGroupInfo)
{
setRunTime();
FILE *outFile = pOutFile ? *pOutFile : NULL;
if (!outFile)
return;
if (!pGroupInfo)
pGroupInfo = this;
pGroupInfo->printGroupInfo(outFile);
const ulonglong nConstrMatr = constrCanonical();
char buff[256];
SPRINTF(buff, "\n%10llu matri%s" CONSTRUCTED_IN " ", nConstrMatr, nConstrMatr == 1 ? "x" : "ces");
const size_t len = strlen(buff);
convertTime(runTime(), buff + len, countof(buff) - len, false);
outString(buff, outFile);
const ulonglong nMatr = numbSimpleDesign();
if (nConstrMatr > 0) {
SPRINTF(buff, "%10llu matri%s ha%s no replicated blocks\n", nMatr, nMatr == 1 ? "x" : "ces", nMatr == 1 ? "s" : "ve");
outString(buff, outFile);
}
SPRINTF(buff, "%10llu matri%s fully constructed\n", constrTotal(), constrTotal() == 1 ? "x was" : "ces were");
outString(buff, outFile);
outEnumInformation(pOutFile);
if (removeReportFile) // Remove temporary file with the intermediate results
remove(reportFileName());
}
示例3: receiveVar
uint
receiveVar(char* p_c) {
// Receive the data by stepping the machine until it outputs
// something
do {
// While there's no data, run the timeout counter
RECEIVE_ERROR re;
uint32_t u32_count = 0;
while (!isCharReady()) {
if (u32_count < RECEIVE_TIMEOUT)
u32_count++;
doHeartbeat();
}
// Step the machine
*p_c = inChar();
if (u32_count >= RECEIVE_TIMEOUT)
notifyOfTimeout();
re = stepReceiveMachine(*p_c);
if (re != ERR_NONE) {
outString("Data receive error: ");
outString(getReceiveErrorString());
outChar('\n');
}
} while (!isReceiveMachineChar() && !isReceiveMachineData());
// Note that p_c already contains the received character, since it's
// always the last thing received from inChar().
return getReceiveMachineIndex();
}
示例4: redefMsg
static void redefMsg(any x, any y) {
outFile *oSave = OutFile;
void (*putSave)(int) = Env.put;
OutFile = OutFiles[STDERR_FILENO], Env.put = putStdout;
outString("# ");
print(x);
if (y)
space(), print(y);
outString(" redefined\n");
Env.put = putSave, OutFile = oSave;
}
示例5: tempDes
void CMMF_TSU_DEVSOUND_TestInterface1DeMux::DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage)
{
TMMFDevSoundCIMessageData data;
// decode message
iUtility->GetAsyncMessageDataL(aMessage, data);
if (data.iCommand != EMMFDevSoundCITestAsyncResult)
{
User::Leave(KErrNotSupported);
}
// check descriptor
HBufC8* tempBuf = HBufC8::NewL(iUtility->InputDesLength(aMessage));
CleanupStack::PushL(tempBuf);
TPtr8 tempDes(tempBuf->Des());
iUtility->ReadFromInputDesL(aMessage, &tempDes);
if (tempDes != KDevSoundCITestIn)
{
User::Leave(KErrCorrupt);
}
// write to the output buffer
TPtrC8 outString(KDevSoundCITestOut);
iUtility->WriteToOutputDesL(aMessage, outString);
// complete the message
iUtility->CompleteMessage(aMessage, KErrNone);
CleanupStack::PopAndDestroy(); // tempBuf
}
示例6: onDrawContent
void onDrawContent(SkCanvas* canvas) override {
SkPaint paint;
SkSafeUnref(paint.setTypeface(SkTypeface::CreateFromFile("/skimages/samplefont.ttf")));
paint.setAntiAlias(true);
paint.setFilterQuality(kMedium_SkFilterQuality);
SkString outString("fps: ");
fTimer.end();
// TODO: generalize this timing code in utils
fTimes[fCurrentTime] = (float)(fTimer.fWall);
fCurrentTime = (fCurrentTime + 1) & 0x1f;
float meanTime = 0.0f;
for (int i = 0; i < 32; ++i) {
meanTime += fTimes[i];
}
meanTime /= 32.f;
SkScalar fps = 1000.f / meanTime;
outString.appendScalar(fps);
outString.append(" ms: ");
outString.appendScalar(meanTime);
SkString modeString("Text scale: ");
modeString.appendU32(fSizeScale);
modeString.append("x");
fTimer.start();
canvas->save();
#if SK_SUPPORT_GPU
SkBaseDevice* device = canvas->getDevice_just_for_deprecated_compatibility_testing();
GrContext* grContext = canvas->getGrContext();
if (grContext) {
GrTexture* tex = grContext->getFontAtlasTexture(GrMaskFormat::kA8_GrMaskFormat);
reinterpret_cast<SkGpuDevice*>(device)->drawTexture(tex,
SkRect::MakeXYWH(512, 10, 512, 512), paint);
}
#endif
canvas->translate(180, 180);
canvas->rotate(fRotation);
canvas->scale(fScale, fScale);
canvas->translate(-180, -180);
const char* text = "Hamburgefons";
size_t length = strlen(text);
SkScalar y = SkIntToScalar(0);
for (int i = 12; i <= 26; i++) {
paint.setTextSize(SkIntToScalar(i*fSizeScale));
y += paint.getFontSpacing();
DrawTheText(canvas, text, length, SkIntToScalar(110), y, paint);
}
canvas->restore();
paint.setTextSize(16);
// canvas->drawText(outString.c_str(), outString.size(), 512.f, 540.f, paint);
canvas->drawText(modeString.c_str(), modeString.size(), 768.f, 540.f, paint);
}
示例7: main
int main(void) {
int16_t i16_c;
if (_POR) {
i16_b = 0;
_POR = 0;
}
configBasic(HELLO_MSG);
outString("Hello world!\n");
++i16_a;
++i16_b;
++i16_c;
printf("a = %d, b = %d, c = %d\n", i16_a, i16_b, i16_c);
while (1) {
// Do nothing.
// After powering the chip on:
//
// - What is the value of a at this line? Either a number or x if
// unknown.
// - What is the value of b at this line? Either a number or x if
// unknown.
//
// After pressing the MCLR button once:
//
// - What is the value of a at this line? Either a number or x if
// unknown.
// - What is the value of b at this line? Either a number or x if
// unknown.
}
}
示例8: solutionSize
void CRowSolution<T>::printRow(FILE *file, PERMUT_ELEMENT_TYPE *pPerm, const T *pSol) const
{
char buffer[512], *pBuf = buffer;
for (size_t j = 0; j < numSolutions(); j++) {
size_t idx = pPerm? *(pPerm + j) : j;
if (pSol)
idx = *(pSol + idx * solutionSize());
pBuf += sprintf_s(pBuf, sizeof(buffer) - (pBuf - buffer), "%2zd", idx % 100);
if (pBuf >= buffer + sizeof(buffer) - 2)
outString(pBuf = buffer, file);
}
sprintf_s(pBuf, sizeof(buffer) - (pBuf - buffer), "\n");
outString(buffer, file);
}
示例9: main
int main() {
str = "Kitty on your lap\n";
printf(str);
outString();
return 0;
}
示例10: atoi
void Log::SetLogFileLevel(char *Level) {
int32 NewLevel = atoi((char*) Level);
if (NewLevel < 0)
NewLevel = 0;
m_logFileLevel = NewLevel;
outString("LogFileLevel is %u", m_logFileLevel);
}
示例11: MUTEX_LOCK
void CRowSolution<T>::printSolutions(FILE *file, bool markNextUsed) const
{
if (!solutionSize() || !numSolutions())
return;
MUTEX_LOCK(out_mutex);
char buffer[2048];
if (numSolutions() >= sizeof(buffer) / 2) {
if (markNextUsed) {
SPRINTF(buffer, "Using solution # %zd out of %zd\n", solutionIndex(), numSolutions());
outString(buffer, file);
}
}
else {
if (markNextUsed) {
const size_t len2 = sizeof(buffer) << 1;
const size_t len = solutionIndex() * 2;
const size_t nLoops = len / len2;
size_t idx = 0;
for (size_t j = 0; j < nLoops; j++) {
idx = setSolutionFlags(buffer, sizeof(buffer), idx);
buffer[sizeof(buffer)-1] = '\0';
outString(buffer, file);
}
const size_t lastLen = 2 * (numSolutions() - idx);
setSolutionFlags(buffer, lastLen, idx);
buffer[len % len2 + 1] = '*';
strcpy_s(buffer + lastLen, sizeof(buffer)-lastLen, "\n");
outString(buffer, file);
}
printRow(file);
PERMUT_ELEMENT_TYPE *pPerm = solutionPerm() ? solutionPerm()->GetData() : NULL;
if (pPerm)
printRow(file, pPerm);
const VECTOR_ELEMENT_TYPE *pSolution = firstSolution();
for (unsigned int i = 0; i < solutionSize(); i++)
printRow(file, pPerm, pSolution + i);
}
MUTEX_UNLOCK(out_mutex);
}
示例12: outString
void ACGI::cgiEncodeAndOutputURL(const char *pccSource, int iLength)
{
char *pcOut = g_aCrypto.convertoEncodeURL(pccSource, iLength);
if (pcOut)
outString(pcOut);
delete []pcOut;
}
示例13: outStringN
void ACGI::cgiStartFORM(const char *pccAction, const char *pccMethod)
{
outStringN("<FORM ACTION=\"");
if (pccAction) outString(pccAction);
else cgiGetScriptName(0x1);
outStringN("\" METHOD=");
if (pccMethod) outStringQ(pccMethod);
else outStringQ("POST");
outStringCRN(">");
}
示例14: traceIndent
static void traceIndent(int i, any x, char *s) {
if (i > 64)
i = 64;
while (--i >= 0)
Env.put(' ');
if (isSym(x))
print(x);
else
print(car(x)), space(), print(cdr(x)), space(), print(val(This));
outString(s);
}
示例15: SPRINTF
void CEnumInfo<T>::outEnumAdditionalInfo(FILE **pOutFile) const
{
FILE *outFile = pOutFile ? *pOutFile : NULL;
if (!outFile)
return;
char buff[256];
SPRINTF(buff, "%10llu matri%s fully constructed\n", constrTotal(), constrTotal() == 1 ? "x was" : "ces were");
outString(buff, outFile);
outEnumInformation(pOutFile);
}