Ejemplo n.º 1
0
Reflection::Reflection(char* pString)
{
    char* tEndPointer;
    char tempString[10];
    
    tHKL = new Matrix<short>(1, 3);
    if (!containsOnly(pString, " 0123456789.-+\n\r"))
    {
        throw MyException(kBadlyFormatedStringN, kBadlyFormatedString);
    }
    strncpy(tempString, pString, 4);
    tempString[4] = 0;
    tHKL->setValue((short)strtol(tempString, &tEndPointer, 10), 0); // H == 0
    strncpy(tempString, pString+4, 4);
    tempString[4] = 0;
    tHKL->setValue((short)strtol(tempString, &tEndPointer, 10), 1); //K == 1
    strncpy(tempString, pString+8, 4);
    tempString[4] = 0;
    tHKL->setValue((short)strtol(tempString, &tEndPointer, 10), 2); //L == 2
    strncpy(tempString, pString+12, 8);
    tempString[8] = 0;
    i = (float)strtod(tempString, &tEndPointer);
    strncpy(tempString, pString+20, 8);
    tempString[8] = 0;
    iSE = (float)strtod(tempString, &tEndPointer);
}
Ejemplo n.º 2
0
static bool isDivider (const String& line)
{
    auto afterIndent = line.trim();

    if (afterIndent.startsWith ("//") && afterIndent.length() > 20)
    {
        afterIndent = afterIndent.substring (2);

        if (afterIndent.containsOnly ("=")
            || afterIndent.containsOnly ("/")
            || afterIndent.containsOnly ("-"))
        {
            return true;
        }
    }

    return false;
}
Ejemplo n.º 3
0
bool String::containsOnly(char* pChars)
{
    return containsOnly(iString, pChars);
}
Ejemplo n.º 4
0
bool String::containsOnly(String& pChars)
{
    return containsOnly(iString, pChars.getCString());
}