示例#1
0
bool IsMeetSchemeOfABABA(char *str, int lenOfA, int lenOfB)
{
	return IsStringEqual(str, str + lenOfA + lenOfB, lenOfA) &&
		IsStringEqual(str, str + (lenOfA + lenOfB) * 2, lenOfA) &&
		IsStringEqual(str + lenOfA, str + 2 * lenOfA + lenOfB, lenOfB) &&
		!(lenOfA == lenOfB &&IsStringEqual(str, str + lenOfA, lenOfA));
}
	bool operator==(const WIN32_FIND_DATA& lhs, const WIN32_FIND_DATA& rhs) {
		if ( lhs.dwFileAttributes == rhs.dwFileAttributes && // The file attributes of a file
			lhs.ftCreationTime.dwLowDateTime == rhs.ftCreationTime.dwLowDateTime && // when a file was created
			lhs.ftCreationTime.dwHighDateTime == rhs.ftCreationTime.dwHighDateTime &&
			lhs.ftLastAccessTime.dwLowDateTime == rhs.ftLastAccessTime.dwLowDateTime && // when the file was last read from, written to, or for executable files, run
			lhs.ftLastAccessTime.dwHighDateTime == rhs.ftLastAccessTime.dwHighDateTime &&
			lhs.ftLastWriteTime.dwLowDateTime == rhs.ftLastWriteTime.dwLowDateTime && // when the file was last written to, truncated, or overwritten
			lhs.ftLastWriteTime.dwHighDateTime == rhs.ftLastWriteTime.dwHighDateTime &&
			lhs.nFileSizeLow == rhs.nFileSizeLow && // file size
			lhs.nFileSizeHigh == rhs.nFileSizeHigh &&
			IsStringEqual(lhs.cFileName, rhs.cFileName)) // The name of the file.
			return true;
		else return false;
	}
示例#3
0
inline bool iuConsole::HasColorConsole()
{
#if !IUTEST_HAS_COLORCONSOLE
    return false;
#else
#if defined(IUTEST_OS_WINDOWS)
    {
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        if( ::GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) )
        {
            return true;
        }
    }
#endif
    const char* env = internal::posix::GetEnv("TERM");
    const bool term_conf = (env != NULL) && (
        IsStringEqual(env, "xterm")
        || IsStringEqual(env, "xterm-color")
        || IsStringEqual(env, "xterm-256color")
        || IsStringEqual(env, "screen")
        || IsStringEqual(env, "screen-256color")
        || IsStringEqual(env, "tmux")
        || IsStringEqual(env, "tmux-256color")
        || IsStringEqual(env, "rxvt-unicode")
        || IsStringEqual(env, "rxvt-unicode-256color")
        || IsStringEqual(env, "linux")
        || IsStringEqual(env, "cygwin")
        );
    return term_conf;
#endif
}
示例#4
0
bool IsMeetSchemeOfABABCAB(char *str, int lenOfAB, int lenOfC)
{
	return IsStringEqual(str, str + lenOfAB, lenOfAB) && IsStringEqual(str, str + lenOfAB * 2 + lenOfC, lenOfAB);
}
示例#5
0
bool IsSameAmongABC(char * str, int lenOfA, int lenOfB, int lenOfC)
{
	return lenOfA == lenOfB && IsStringEqual(str, str + lenOfA, lenOfA) ||
		lenOfA == lenOfC && IsStringEqual(str, str + (lenOfA + lenOfB) * 2, lenOfA) || 
		lenOfB == lenOfC && IsStringEqual(str + lenOfA, str + (lenOfA + lenOfB) * 2, lenOfB);
}
	bool operator!=(const WIN32_FIND_DATA& lhs, const WIN32_FIND_DATA& rhs) {
		return IsStringEqual(lhs.cFileName, rhs.cFileName);
	}