当前位置: 首页>>代码示例>>C++>>正文


C++ SimpleString类代码示例

本文整理汇总了C++中SimpleString的典型用法代码示例。如果您正苦于以下问题:C++ SimpleString类的具体用法?C++ SimpleString怎么用?C++ SimpleString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SimpleString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetWindowText

void GetWindowText(HWindow *pwnd, SimpleString &str)
{
	int len = pwnd->GetWindowTextLength() + 1;
	str.SetSize(len);
	pwnd->GetWindowTextA(str, len);
}
开发者ID:derekdreery,项目名称:frhed,代码行数:6,代码来源:hexwdlg.cpp

示例2: containsNoCase

bool SimpleString::containsNoCase(const SimpleString& other) const
{
	return toLower().contains(other.toLower());
}
开发者ID:conniechen19870216,项目名称:kavonUT,代码行数:4,代码来源:SimpleString.cpp

示例3: equalsNoCase

bool SimpleString::equalsNoCase(const SimpleString& str) const
{
	return toLower() == str.toLower();
}
开发者ID:conniechen19870216,项目名称:kavonUT,代码行数:4,代码来源:SimpleString.cpp

示例4:

bool easyunit::operator== (const SimpleString& left, const SimpleString& right)
{
	return !strcmp (left.asCharString (), right.asCharString ());
}
开发者ID:bossiernesto,项目名称:Strongtalk,代码行数:4,代码来源:simplestring.cpp

示例5:

bool operator==(const SimpleString& left, const SimpleString& right)
{
    return 0 == SimpleString::StrCmp(left.asCharString(), right.asCharString());
}
开发者ID:cuitoldfish,项目名称:cpputest,代码行数:4,代码来源:SimpleString.cpp

示例6: StringFromFormat

ContainsFailure::ContainsFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual) :
	TestFailure(test, fileName, lineNumber)
{
	message_ = StringFromFormat("actual <%s>\n\tdid not contain  <%s>", actual.asCharString(), expected.asCharString());
}
开发者ID:dreadlock,项目名称:cpputest,代码行数:5,代码来源:TestFailure.cpp

示例7: match

bool TestFilter::match(const SimpleString& name) const
{
	if (strictMatching_)
		return name == filter_;
	return name.contains(filter_);
}
开发者ID:CNCBASHER,项目名称:mri,代码行数:6,代码来源:TestFilter.cpp

示例8: print

void UtestShell::print(const SimpleString& text, const char* fileName, int lineNumber)
{
	print(text.asCharString(), fileName, lineNumber);
}
开发者ID:adrienhendra,项目名称:cpputest,代码行数:4,代码来源:Utest.cpp

示例9: XTRACE_BEGIN

/*virtual*/ void EldritchFramework::Initialize() {
  XTRACE_FUNCTION;

  XTRACE_BEGIN(PreFramework3D);
  ReverseHash::Initialize();

  PackStream::StaticAddPackageFile("eldritch-base.cpk");
  FrameworkUtil::MinimalLoadConfigFiles("Config/default.ccf");

  InitializePackages();

  InitializeDLC();

  // Load prefs over anything in the defaults.
  LoadPrefsConfig();

  LOADPRINTLEVELS;

  STATICHASH(Version);
  STATICHASH(ContentSyncer);
  SimpleString LocalVersion =
      ConfigManager::GetString(sVersion, "", sContentSyncer);
  PRINTF("Version: %s\n", LocalVersion.CStr());

  XTRACE_BEGIN(InitializeFactories);
  PRINTF("Initializing factories...\n");

  PRINTF("Initializing SDP factories.\n");
  SDPFactory::InitializeBaseFactories();
#define ADDSDPFACTORY(type) \
  SDPFactory::RegisterSDPFactory(#type, SDP##type::Factory);
#include "eldritchsdps.h"
#undef ADDSDPFACTORY

  PRINTF("Initializing UI factories.\n");
  UIFactory::InitializeBaseFactories();
#define ADDUISCREENFACTORY(type) \
  UIFactory::RegisterUIScreenFactory(#type, UIScreen##type::Factory);
#include "eldritchuiscreens.h"
#undef ADDUISCREENFACTORY

  PRINTF("Initializing anim event factories.\n");
#define ADDANIMEVENTFACTORY(type) \
  AnimEventFactory::GetInstance()->Register(#type, AnimEvent##type::Factory);
#include "eldritchanimevents.h"
#undef ADDANIMEVENTFACTORY

  PRINTF("Initializing PE factories.\n");
  WBParamEvaluatorFactory::InitializeBaseFactories();
#define ADDWBPEFACTORY(type) \
  WBParamEvaluatorFactory::RegisterFactory(#type, WBPE##type::Factory);
#include "rodinwbpes.h"
#include "eldritchwbpes.h"
#undef ADDWBPEFACTORY

  PRINTF("Initializing action factories.\n");
  WBActionFactory::InitializeBaseFactories();
#define ADDWBACTIONFACTORY(type) \
  WBActionFactory::RegisterFactory(#type, WBAction##type::Factory);
#include "uiwbactions.h"
#include "rodinwbactions.h"
#include "eldritchwbactions.h"
#undef ADDWBPEFACTORY

  PRINTF("Initializing BT factories.\n");
  RodinBTNodeFactory::InitializeBaseFactories();
#define ADDRODINBTNODEFACTORY(type) \
  RodinBTNodeFactory::RegisterFactory(#type, RodinBTNode##type::Factory);
#include "eldritchrodinbtnodes.h"
#undef ADDRODINBTNODEFACTORY

  // Initialize core and Eldritch Workbench component factories.
  PRINTF("Initializing component factories.\n");
  WBComponent::InitializeBaseFactories();
#define ADDWBCOMPONENT(type) \
  WBComponent::RegisterWBCompFactory(#type, WBComp##type::Factory);
#include "rodinwbcomponents.h"
#include "eldritchwbcomponents.h"
#undef ADDWBCOMPONENT
  XTRACE_END;

  PRINTF("Factories initialized.\n");

  // Create input system before framework so it will exist for UI. But don't
  // attach devices yet, as they don't exist.
  PRINTF("Initializing input system.\n");
  m_InputSystem = new InputSystem;
  m_InputSystem->Initialize("EldritchInput");
  XTRACE_END;

  Framework3D::Initialize();

  STATICHASH(DisplayWidth);
  STATICHASH(DisplayHeight);
  m_DisplayWidth = ConfigManager::GetInt(sDisplayWidth);
  m_DisplayHeight = ConfigManager::GetInt(sDisplayHeight);

#if BUILD_WINDOWS
  m_CheckForUpdates = new CheckForUpdates(m_UIManager);
#endif
//.........这里部分代码省略.........
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:101,代码来源:eldritchframework.cpp

示例10: MockFailure

MockUnexpectedObjectFailure::MockUnexpectedObjectFailure(UtestShell* test, const SimpleString& functionName, const void* actual, const MockExpectedCallsList& expectations) : MockFailure(test)
{
    message_ = StringFromFormat ("MockFailure: Function called on an unexpected object: %s\n"
                                 "\tActual object for call has address: <%p>\n", functionName.asCharString(),actual);
    addExpectationsAndCallHistoryRelatedTo(functionName, expectations);
}
开发者ID:Andne,项目名称:cpputest,代码行数:6,代码来源:MockFailure.cpp

示例11: SDL_Init

/*virtual*/ void Framework3D::Initialize() {
  XTRACE_FUNCTION;

  m_IsInitializing = true;

#if BUILD_SDL
  const int Error = SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO |
                             SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER |
                             SDL_INIT_EVENTS | SDL_INIT_NOPARACHUTE);
  ASSERT(0 == Error);
  Unused(Error);
  if (0 != Error) {
    PRINTF("SDL_Init: %s\n", SDL_GetError());
  }

  SDL_DisableScreenSaver();
  #ifdef HAVE_GLES
  SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
  SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
  SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);

//  SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
//  SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
  #endif
#endif

  STATICHASH(Framework);

#if BUILD_WINDOWS
#if BUILD_FINAL
  STATICHASH(ShowConsole);
  const bool ShowConsole =
      ConfigManager::GetBool(sShowConsole, false, sFramework);
  if (ShowConsole)
#endif
  {
    Console::GetInstance()->SetPos(0, 0);
  }
#endif

  STATICHASH(UseRandomSeed);
  const bool UseRandomSeed =
      ConfigManager::GetBool(sUseRandomSeed, false, sFramework);

  STATICHASH(RandomSeed);
  const int RandomSeed = ConfigManager::GetInt(sRandomSeed, 0, sFramework);

  if (UseRandomSeed) {
    Math::SeedGenerator(RandomSeed);
  } else {
    Math::SeedGenerator();
  }

  STATICHASH(UseFixedFrameTime);
  m_UseFixedFrameTime =
      ConfigManager::GetBool(sUseFixedFrameTime, true, sFramework);
#ifdef HAVE_GLES0
  m_UseFixedFrameTime = false;    // GLES hardware are less powerfull than Desktop
#endif

  STATICHASH(FixedFrameTime);
  m_FixedFrameTime =
      ConfigManager::GetFloat(sFixedFrameTime, 1.0f / 60.0f, sFramework);
  #ifdef PANDORA
      m_FixedFrameTime = 1.0f / 14.0f;  // 60fps cannot be sustained on the Pandora
  #endif
  STATICHASH(FramesLimit);
  const int FramesLimit = ConfigManager::GetInt(sFramesLimit, 5, sFramework);
  m_FrameTimeLimit = m_FixedFrameTime * static_cast<float>(FramesLimit);

  STATICHASH(DoVideoCapture);
  m_DoVideoCapture = ConfigManager::GetBool(sDoVideoCapture, false, sFramework);

  STATICHASH(VideoCaptureFixedFrameTime);
  m_VideoCaptureFixedFrameTime = ConfigManager::GetFloat(
      sVideoCaptureFixedFrameTime, 1.0f / 30.0f, sFramework);
  #ifdef PANDORA
      sVideoCaptureFixedFrameTime = 1.0f / 8.0f;  // 30fps cannot be sustained on the Pandora (even 10fps I'm not sure)
  #endif

  uint DisplayWidth = 0;
  uint DisplayHeight = 0;
  SimpleString WindowTitle;

  // Loads display parameters from config, so GetInitialDisplaySize can use
  // that.
  m_Display = new Display;

  // Make sure that we use a supported resolution regardless of what the config
  // file said.
  const SDisplayMode BestDisplayMode =
      m_Display->GetBestDisplayMode(m_Display->m_Width, m_Display->m_Height);
  m_Display->SetResolution(BestDisplayMode.Width, BestDisplayMode.Height);

  uint WindowIcon = 0;
  GetInitialWindowIcon(WindowIcon);
  GetInitialDisplaySize(DisplayWidth, DisplayHeight);
  GetInitialWindowTitle(WindowTitle);

  CreateSplashWindow(WindowIcon, WindowTitle.CStr());
//.........这里部分代码省略.........
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:101,代码来源:framework3d.cpp

示例12: FlushWidgets

void UIScreenEldSetRes::InitializeFromDefinition(
    const SimpleString& DefinitionName) {
  FlushWidgets();
  m_ResMap.Clear();

  UIScreen::InitializeFromDefinition(DefinitionName);

  Display* const pDisplay = m_UIManager->GetDisplay();
  Array<SDisplayMode> DisplayModes;
  m_UIManager->GetRenderer()->EnumerateDisplayModes(DisplayModes);
  DisplayModes.InsertionSort();
  ASSERT(DisplayModes.Size());

  MAKEHASH(DefinitionName);

  // Dynamically create definitions for each text button

  STATICHASH(Rules);
  SimpleString UsingRules =
      ConfigManager::GetString(sRules, "", sDefinitionName);

  MAKEHASH(UsingRules);

  STATICHASH(Archetype);
  const char* const ArchetypeName =
      ConfigManager::GetString(sArchetype, "", sUsingRules);

  STATICHASH(Parent);
  const char* const Parent = ConfigManager::GetString(sParent, "", sUsingRules);

  STATICHASH(PixelYBase);
  const float YBase = ConfigManager::GetFloat(sPixelYBase, 0.0f, sUsingRules);

  STATICHASH(PixelYStep);
  const float YStep = ConfigManager::GetFloat(sPixelYStep, 0.0f, sUsingRules);

  STATICHASH(Column0PixelX);
  const float Column0X =
      ConfigManager::GetFloat(sColumn0PixelX, 0.0f, sUsingRules);

  STATICHASH(Column1PixelX);
  const float Column1X =
      ConfigManager::GetFloat(sColumn1PixelX, 0.0f, sUsingRules);

#if DEBUG_SETRES
  PRINTF("UIScreenEldSetRes info:\n");
  PRINTF("  ScreenWidth:  %d\n", pDisplay->m_ScreenWidth);
  PRINTF("  ScreenHeight: %d\n", pDisplay->m_ScreenHeight);
#endif

  FOR_EACH_ARRAY_REVERSE(DisplayIter, DisplayModes, SDisplayMode) {
    const SDisplayMode& DisplayMode = DisplayIter.GetValue();
    if (!pDisplay->m_Fullscreen &&
        (DisplayMode.Width > pDisplay->m_ScreenWidth ||
         DisplayMode.Height > pDisplay->m_ScreenHeight)) {
#if DEBUG_SETRES
      PRINTF("  Skipping mode %dx%d:\n", DisplayMode.Width, DisplayMode.Height);
#endif
      DisplayModes.FastRemove(DisplayIter);
    }
  }

  const int NumDisplayModes = static_cast<int>(DisplayModes.Size());
  const int LeftColumnSize = (NumDisplayModes + 1) / 2;
  const int RightColumnSize =
      (NumDisplayModes + 1) - LeftColumnSize;  // Add one for the Back button

  for (int DisplayModeIndex = 0; DisplayModeIndex < NumDisplayModes;
       ++DisplayModeIndex) {
    const SDisplayMode& DisplayMode = DisplayModes[DisplayModeIndex];

    float ScreenX = 0.0f;
    float ScreenY = 0.0f;

    int FocusShiftUp = 0;
    int FocusShiftDown = 0;
    int FocusShiftLeft = 0;
    int FocusShiftRight = 0;

    if (DisplayModeIndex < LeftColumnSize) {
      // Display mode is in left column
      ScreenY = YBase + DisplayModeIndex * YStep;
      ScreenX = Column0X;
      FocusShiftLeft = -RightColumnSize;
      FocusShiftRight = LeftColumnSize;
    } else {
      // Display mode is in right column
      ScreenY = YBase + (DisplayModeIndex - LeftColumnSize) * YStep;
      ScreenX = Column1X;
      FocusShiftLeft = -LeftColumnSize;
      FocusShiftRight = RightColumnSize;
    }

    if (DisplayModeIndex == 0) {
      // Display mode is on top left
      FocusShiftUp = -(RightColumnSize + 1);
    } else if (DisplayModeIndex == (LeftColumnSize - 1)) {
      // Display mode is on bottom left
      FocusShiftDown = (RightColumnSize + 1);

//.........这里部分代码省略.........
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:101,代码来源:uiscreen-eldsetres.cpp

示例13: SL_CallbackObjects


//.........这里部分代码省略.........

						offset += length_header + length_msg + tag_end_size;
						size =  occupiedSize - offset;

						// Ok, we have someone connected
					}
					//					else if(length_msg == 0)
					//					{
					//						//std::cout << "Empty Msg from "<<pid<<"\n";
					//						offset += length_header;
					//						size =  occupiedSize - offset;
					//					}
					else
					{
						offset += length_header;

						unsigned char* msgptr =  (buffer+offset);

						//verif end tag
						if( memcmp(tag_end, (msgptr + length_msg), tag_end_size))
						{
							OmiscidTrace( "warning end tag\n");
							size =  occupiedSize - offset;
						}
						else
						{
							offset += length_msg + tag_end_size;
							size =  occupiedSize - offset;
#ifdef DEBUG
							if ( Debug & DBG_RECV )
							{
								if ( length_msg != 0 )
								{
									SimpleString SFormat = "MsgSocket::Recv: %";
									SFormat += length_msg;
									SFormat += ".";
									SFormat += length_msg;
									SFormat += "s\n";
									fprintf( stderr, SFormat.GetStr(), msgptr );
								}
								else
								{
									fprintf( stderr, "MsgSocket::Recv: <empty>\n" );
								}
							}
#endif
							// Send info to all receiver
							SL_CallbackObjects.Lock();
							if ( CallbackObjects.GetNumberOfElements() )
							{
								// Prepare data
								*(msgptr+length_msg)='\0';
								callbackData.Msg.len = length_msg;
								if ( length_msg != 0 )
								{
									callbackData.Msg.buffer =  (char*)msgptr;
								}
								else
								{
									callbackData.Msg.buffer =  (char*)NULL;
								}
								callbackData.Msg.origine = FromTCP;
								callbackData.Msg.pid = pid;
								callbackData.Msg.mid = mid;

								// Send info to all listener
开发者ID:AmibisLabs,项目名称:amibis-cpp,代码行数:67,代码来源:MsgSocket.cpp

示例14: strcpy

SimpleString::SimpleString(const SimpleString& other)
{
    buffer = new char [other.size() + 1];
    strcpy(buffer, other.buffer);
}
开发者ID:mpetri,项目名称:OrderedSet,代码行数:5,代码来源:SimpleString.cpp

示例15: createButWasString

SimpleString TestFailure::createButWasString(const SimpleString& expected, const SimpleString& actual)
{
	return StringFromFormat("expected <%s>\n\tbut was  <%s>", expected.asCharString(), actual.asCharString());
}
开发者ID:dreadlock,项目名称:cpputest,代码行数:4,代码来源:TestFailure.cpp


注:本文中的SimpleString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。