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


C++ CStdString::Trim方法代码示例

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


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

示例1: CheckBuiltInProperties

void CPPTUtil::CheckBuiltInProperties(IDispatch* pX) throw (Workshare::Exception)
{
   if (0 == pX) 
      throw Workshare::Exception(_T("Invalid dispatch pointer passed in"));

   PowerPoint::_PresentationPtr  pPresentation(pX);
   IDispatchPtr spBuiltInProps = pPresentation->BuiltInDocumentProperties;

   _bstr_t bstrName = _T("");
   _bstr_t bstrValue = _T("");
   CStdString sMsg;

   PowerPoint::PpBuiltInProperty ppPropertyIndex[] = {PowerPoint::ppPropertyTitle, 
      PowerPoint::ppPropertySubject, 
      PowerPoint::ppPropertyAuthor, 
      PowerPoint::ppPropertyKeywords, 
      PowerPoint::ppPropertyComments, 
      PowerPoint::ppPropertyCategory, 
      PowerPoint::ppPropertyManager, 
      PowerPoint::ppPropertyCompany, 
      PowerPoint::ppPropertyHyperlinkBase};

   long lCount = sizeof(ppPropertyIndex)/sizeof(PowerPoint::PpBuiltInProperty);
   CStdString sErr;

   for (long lIndex = 0; lIndex < lCount; lIndex++)
   {
      HRESULT hr = CCOMDispatchHelper::GetPropertyItemValues(spBuiltInProps, ppPropertyIndex[lIndex], 
         bstrName, bstrValue);

      if (FAILED(hr))
      {
         sErr.Format(_T("CCOMDispatchHelper::GetPropertyItemValues() failed for property index, %ld - Error Code, %ld"), 
            lIndex, hr);

         throw Workshare::Com::ComException(sErr.c_str(), hr);
      }

      CStdString sTmp = bstrValue;
      sTmp.Trim();

      if(0 != sTmp.length())
      {
         sErr.Format(_T("%s not properly reset: current value is %s"), (LPCTSTR)bstrName, sTmp.c_str());
         throw Workshare::Exception(sErr.c_str());
      }
   }
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:48,代码来源:PPTUtil.cpp

示例2: AppendToPathInRegistry

bool PathReadWriter::AppendToPathInRegistry(const CStdString& sSubPath)
{
	CStdString sPath = sSubPath;
	::PathRemoveBackslash(sPath.GetBuffer(MAX_PATH));
	sPath.ReleaseBuffer();
	sPath.Trim();
	if (sPath.IsEmpty())
	{
		return true;
	}

	std::vector<CStdString> pathList;
	GetPathListFromRegistry(pathList);
	pathList.push_back(sPath);
	return SetPathListInRegistry(pathList);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:16,代码来源:PathReadWriter.cpp

示例3: GetUnameVersion

CStdString CSysInfo::GetUnameVersion()
{
  CStdString result = "";

  FILE* pipe = popen("uname -rm", "r");
  if (pipe)
  {
    char buffer[256] = {'\0'};
    if (fread(buffer, sizeof(char), sizeof(buffer), pipe) > 0 && !ferror(pipe))
      result = buffer;
    else
      CLog::Log(LOGWARNING, "Unable to determine Uname version");
    pclose(pipe);
  }

  return result.Trim();
}
开发者ID:chris-magic,项目名称:xbmc_dualaudio_pvr,代码行数:17,代码来源:SystemInfo.cpp

示例4: parse_Clean

void CMediaMonitor::parse_Clean(CStdString& strFilename)
{
  char* szBuffer = (char*) strFilename.c_str();
  int start = parse_GetStart ( szBuffer );
  int length = parse_GetLength( szBuffer, start);

  char szCopy[1024];

  if (length < 0)
  {
    length = strlen(&szBuffer[start]);
  }

  char lc = 0;
  for (int i = start, i2 = 0; ((i < start + length) && (szBuffer[i] != 0)); i++)
  {
    char c = szBuffer[i];

    switch (c)
    {
    case '\r':
    case '\n':
    case ',':
    case '.':
    case '_':
    case '-':
    case ' ':
      c = ' ';
      if (c == lc)
      {
        continue;
      }
      break;
    }

    szCopy[i2++] = c;
    lc = c;
  }

  szCopy[i2] = 0;
  CStdString name = szCopy;
  strFilename = name.Trim();
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:43,代码来源:MediaMonitor.cpp

示例5: RemovePathFromRegistry

bool PathReadWriter::RemovePathFromRegistry(const CStdString& sSubPath)
{
	CStdString sPath = sSubPath;
	::PathRemoveBackslash(sPath.GetBuffer(MAX_PATH));
	sPath.ReleaseBuffer();
	sPath.Trim();
	if (sPath.IsEmpty())
	{
		return true;
	}

	std::vector<CStdString> pathList;
	GetPathListFromRegistry(pathList);

	std::vector<CStdString>::iterator leftover;
	leftover = std::remove_if(pathList.begin(), pathList.end(), MatchesPath(sPath));
	pathList.erase(leftover, pathList.end());

	return SetPathListInRegistry(pathList);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:20,代码来源:PathReadWriter.cpp

示例6: fopen

TEST(TestXBMCTinyXML, ParseFromFileHandle)
{
  bool retval = false;
  // scraper results with unescaped &
  CXBMCTinyXML doc;
  FILE *f = fopen(XBMC_REF_FILE_PATH("/xbmc/utils/test/CXBMCTinyXML-test.xml"), "r");
  ASSERT_TRUE(f);
  doc.LoadFile(f);
  fclose(f);
  TiXmlNode *root = doc.RootElement();
  if (root && root->ValueStr() == "details")
  {
    TiXmlElement *url = root->FirstChildElement("url");
    if (url && url->FirstChild())
    {
      CStdString str = url->FirstChild()->ValueStr();
      retval = (str.Trim() == "http://api.themoviedb.org/3/movie/12244?api_key=57983e31fb435df4df77afb854740ea9&language=en???");
    }
  }
  EXPECT_TRUE(retval);
}
开发者ID:Micromax-56,项目名称:xbmc,代码行数:21,代码来源:TestXBMCTinyXML.cpp

示例7: SetLine

void XLCDproc::SetLine(int iLine, const CStdString& strLine)
{
  if (m_bStop || m_sockfd == -1)
    return;

  if (iLine < 0 || iLine >= (int)m_iRows)
    return;

  CStdString strLineLong = strLine;
  strLineLong.Trim();
  StringToLCDCharSet(strLineLong);

  //make string fit the display if it's smaller than the width
  if (strLineLong.size() < m_iColumns)
    strLineLong.append(m_iColumns - strLineLong.size(), ' ');
  //else if the string doesn't fit the display, lcdproc will scroll it, so we need a space
  else if (strLineLong.size() > m_iColumns)
    strLineLong += " ";

  if (strLineLong != m_strLine[iLine])
  {
    CStdString cmd;
    int ln = iLine + 1;

    if (g_advancedSettings.m_lcdScrolldelay != 0)
      cmd.Format("widget_set xbmc line%i 1 %i %i %i m %i \"%s\"\n", ln, ln, m_iColumns, ln, g_advancedSettings.m_lcdScrolldelay, strLineLong.c_str());
    else
      cmd.Format("widget_set xbmc line%i 1 %i \"%s\"\n", ln, ln, strLineLong.c_str());

    if (write(m_sockfd, cmd.c_str(), cmd.size()) == -1)
    {
      CLog::Log(LOGERROR, "XLCDproc::%s - Unable to write to socket", __FUNCTION__);
      CloseSocket();
      return;
    }
    m_bUpdate[iLine] = true;
    m_strLine[iLine] = strLineLong;
    m_event.Set();
  }
}
开发者ID:RobertMe,项目名称:xbmc,代码行数:40,代码来源:XLCDproc.cpp

示例8: OnOK

void COptionsDlgSelector::OnOK() 
{
	DvLicenceHelper licHelper;
	if (!licHelper.IsComparisonAllowed())
	{
		licHelper.ShowNoLicenceMessage();
		CWSDialog::OnOK();
		return;
	}

	if ( Workshare::OptionApi::GetBool(L"ShowDocDesciptionWhenSelecting") )	
	{
		int nCurSel = m_cboDocumentOne.GetCurSel();
		CStdString sDocOne(L"");
		m_cboDocumentOne.GetLBText(nCurSel, sDocOne.GetBuffer(MAX_PATH*2));
		sDocOne.ReleaseBuffer();
		CStdString sDocOneId = m_documentIDLookup[ sDocOne ];
		sDocOneId = sDocOneId.Trim();
		if ( !sDocOneId.IsEmpty() )
		{
			m_cboDocumentOne.SetWindowText( sDocOneId );
		}		

		for( int nModifiedDocumentIndex = 0; nModifiedDocumentIndex < 5; nModifiedDocumentIndex++ )
		{				
			CStdString sDocTwo( m_multiModifiedDlg.GetModifiedText( nModifiedDocumentIndex ) );
			CStdString sDocTwoId = m_documentIDLookup[ sDocTwo ];
			sDocTwoId = sDocTwoId.Trim();
			if ( !sDocTwoId.IsEmpty() )
			{
				m_multiModifiedDlg.SetModifiedText( nModifiedDocumentIndex , sDocTwoId );
			}
		}
	}

	if( IsWindowVisible() )
		UpdateData();

	if( !ValidateFilesSelected() )
		return;

	ValidateRenderingSetOptions();

	// Remove these buttons.
	m_btnOk.EnableWindow(false);
	m_StaticHyperLinkHelp.EnableWindow(false);
	m_btnCancel.EnableWindow(false);

	// Hide this window offscreen - do not actually hide it with SW_HIDE as that throws the main window into the background
	WINDOWPLACEMENT placement;
	RECT rect;
	GetWindowPlacement(&placement);
	GetWindowRect(&rect);
	SetWindowPos(NULL, -20000,-20000,1,1,SWP_NOACTIVATE|SWP_NOZORDER);

	// Clear the failure list of all message resource IDs.
	GetApp()->ClearFailMessageList();

	if( StartComparisons() )
	{
		// Success so kill this dialog.
		EndDialog(IDOK);
	}
	else
	{
		// Comparison was unsuccessful.
		CStdString sHeaderLine = CStdString::LoadResource(IDS_TXTEX_failedToCompareDocuments5033, L"Failed to compare documents");
		CStdString sDescription = GetApp()->GetFailMessage();
		if (sDescription.GetLength() != 0)
		{
			// Display the failure messages.
			GetApp()->ShowMessageEx(AfxGetMainWnd()->m_hWnd,
				sDescription, WsOK, WsCompare, WsInfoIcon,
				sHeaderLine, -1, LOG_LOCATION);
		}

		// Bring this window back to normal position.
		SetWindowPos(NULL, rect.left, rect.top, rect.right-rect.left, rect.bottom - rect.top, SWP_NOZORDER);
		SetWindowPlacement(&placement);
	}

	// Put the buttons back.
	m_btnOk.EnableWindow(true);
	m_StaticHyperLinkHelp.EnableWindow(true);
	m_btnCancel.EnableWindow(true);

	SetModified(FALSE);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:88,代码来源:OptionsDlgSelector.cpp

示例9: DocFormatSupportsFastComparison

// Determine whether or not Fast (Binary) comparison can be used.
// NB Both original and modified docs must be in DOC format to enable binary compare.
// (See CDVCompareController::SetBinaryComparisonOptionForCurrentComparison)
bool COptionsDlgSelector::DocFormatSupportsFastComparison(bool bListItemSelected)
{		
	CStdString sOriginalFilename = GetOriginalFilename(bListItemSelected);

	if( sOriginalFilename.IsEmpty() )
	{
		return false;
	}

	if ( Workshare::OptionApi::GetBool(L"ShowDocDesciptionWhenSelecting") )	
	{
		CStdString sOriginalId = m_documentIDLookup[ sOriginalFilename ];
		sOriginalId = sOriginalId.Trim();
		if ( !sOriginalId.IsEmpty() )
		{
			sOriginalFilename = sOriginalId;
		}
	}

	HRESULT hr = FileTypeHelper::IsDOC(sOriginalFilename);
	if (FAILED(hr))	// checks connection to DMS is ok first
		return false;

	bool bOriginalIsDOC = hr == S_OK;
	bool bModifiedIsDOC = false;
	bool bOriginalIsDOCX = S_OK == FileTypeHelper::IsDOCX(sOriginalFilename);
	bool bModifiedIsDOCX = false;
	bool bOriginalIsRTF = S_OK == FileTypeHelper::IsRTF(sOriginalFilename);
	bool bModifiedIsRTF = false;

	for( int nModifiedDocumentIndex = 0; nModifiedDocumentIndex < 5; nModifiedDocumentIndex++ )
	{				
		CStdString sDocTwo( m_multiModifiedDlg.GetModifiedText( nModifiedDocumentIndex ) );

		if ( Workshare::OptionApi::GetBool(L"ShowDocDesciptionWhenSelecting") )	
		{
			CStdString sDocTwoId = m_documentIDLookup[ sDocTwo ];
			sDocTwoId = sDocTwoId.Trim();
			if ( !sDocTwoId.IsEmpty() )
			{
				sDocTwo = sDocTwoId;
			}
		}

		if( !sDocTwo.IsEmpty() )
		{
			if (S_OK == FileTypeHelper::IsDOC(sDocTwo) )
			{
				bModifiedIsDOC = true;
				break;
			}
			else if (S_OK == FileTypeHelper::IsDOCX(sDocTwo) )
			{
				bModifiedIsDOCX = true;
				break;
			}
			else if (S_OK == FileTypeHelper::IsRTF(sDocTwo) )
			{
				bModifiedIsRTF = true;
				break;
			}
		}
	}

	m_bFilesAreFastFiles = (bOriginalIsDOC || bOriginalIsDOCX || bOriginalIsRTF) || (bModifiedIsDOC || bModifiedIsDOCX || bModifiedIsRTF);

	return m_bFilesAreFastFiles;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:71,代码来源:OptionsDlgSelector.cpp

示例10: CleanDescription

CStdString EpgStore::CleanDescription(const CStdString& strDescription)
{
  CStdString description = strDescription;

  description.Replace("&nbsp;", " ");

  while (description.Find("<") != -1)
  {
    int start = description.Find("<");
    int end = description.Find(">");
    if (end > start)
      description.Delete(start, end-start+1);
    else
      description.Delete(start, description.GetLength() - start);
  }
  description.Trim();

  description.Replace("\\&", "&");
  description.Replace("&quot;", "\"");
  description.Replace("&amp;", "&");
  description.Replace("&nbsp;", " ");
  description.Replace("&gt;", ">");
  description.Replace("&lt;", "<");

  int i;
  while ((i = description.Find("&#")) >= 0)
  {
    CStdString src = "&#";
    int radix = 10;

    i += 2;
    if (description[i] == 'x' || description[i] == 'X')
    {
      src += description[i];
      i++;
      radix = 16;
    }

    CStdString numStr;
    unsigned long num;
    while (description[i] != ';' && numStr.length() <= 6)
    {
      numStr += description[i];
      src += description[i];
      i++;
    }

    // doesn't make sense....abort
    if (numStr.length() > 6)
    {
      break;
    }

    src += ';';
    char* end;

    if (numStr.IsEmpty())
      break;

    num = strtoul(numStr.c_str(), &end, radix);

    // doesn't make sense....abort
    if (num == 0)
    {
      break;
    }

    CStdStringW utf16;
    utf16 += (wchar_t) num;
    CStdStringA utf8;
    g_charsetConverter.wToUTF8(utf16, utf8);
    description.Replace(src, utf8);
  }

  return description;
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:76,代码来源:epgstore.cpp

示例11: DeSerialize

void UrlSerializer::DeSerialize(CStdString& input)
{
	// read string and extract values into map
	UrlState state = UrlStartState;
	CStdString key;
	CStdString value;
	CStdString errorDescription;

	input.Trim();

	for(unsigned int i=0; i<input.length() && state!= UrlErrorState; i++)
	{
		TCHAR character = input[i];

		switch(state)
		{
		case UrlStartState:
			if(character == '&')
			{
				;	// ignore ampersands
			}
			else if ( ACE_OS::ace_isalnum(character) )
			{
				state = UrlKeyState;
				key = character;
			}
			else
			{
				state = UrlErrorState;
				errorDescription = "Cannot find key start, keys must be alphanum";
			}
			break;
		case UrlKeyState:
			if( ACE_OS::ace_isalnum(character) )
			{
				key += character;
			}
			else if (character == '=')
			{
				state = UrlValueState;
				value.Empty();
			}
			else
			{
				state = UrlErrorState;
				errorDescription = "Invalid key character, keys must be alphanum";
			}
			break;
		case UrlValueState:
			if( character == '=')
			{
				state = UrlErrorState;
				errorDescription = "Value followed by = sign, value should always be followed by space sign";				
			}
			else if (character == '&')
			{
				state = UrlStartState;
			}
			else
			{
				value += character;
			}
			break;
		default:
			state = UrlErrorState;
			errorDescription = "Non-existing state";
		}	// switch(state)

		if ( (state == UrlStartState) || (i == (input.length()-1)) )
		{
			if (!key.IsEmpty())
			{
				// Url unescape
				CStdString unescapedValue;
				UnEscapeUrl(value, unescapedValue);

				// Add pair to key-value map
				m_map.insert(std::make_pair(key, unescapedValue));
				key.Empty();
				value.Empty();
			}
		}
	}	// for(int i=0; i<input.length() && state!= UrlErrorState; i++)

	Serializer::DeSerialize();
}
开发者ID:HiPiH,项目名称:Oreka,代码行数:86,代码来源:UrlSerializer.cpp

示例12: sizeof

bool CWIN32Util::XBMCShellExecute(const CStdString &strPath, bool bWaitForScriptExit)
{
  CStdString strCommand = strPath;
  CStdString strExe = strPath;
  CStdString strParams;
  CStdString strWorkingDir;

  strCommand.Trim();
  if (strCommand.IsEmpty())
  {
    return false;
  }
  int iIndex = -1;
  char split = ' ';
  if (strCommand[0] == '\"')
  {
    split = '\"';
  }
  iIndex = strCommand.Find(split, 1);
  if (iIndex != -1)
  {
    strExe = strCommand.substr(0, iIndex + 1);
    strParams = strCommand.substr(iIndex + 1);
  }

  strExe.Replace("\"","");

  strWorkingDir = strExe; 
  iIndex = strWorkingDir.ReverseFind('\\'); 
  if(iIndex != -1) 
  { 
    strWorkingDir[iIndex+1] = '\0'; 
  } 

  CStdStringW WstrExe, WstrParams, WstrWorkingDir;
  g_charsetConverter.utf8ToW(strExe, WstrExe);
  g_charsetConverter.utf8ToW(strParams, WstrParams);
  g_charsetConverter.utf8ToW(strWorkingDir, WstrWorkingDir);

  bool ret;
  SHELLEXECUTEINFOW ShExecInfo = {0};
  ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
  ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
  ShExecInfo.hwnd = NULL;
  ShExecInfo.lpVerb = NULL;
  ShExecInfo.lpFile = WstrExe.c_str();
  ShExecInfo.lpParameters = WstrParams.c_str();
  ShExecInfo.lpDirectory = WstrWorkingDir.c_str();
  ShExecInfo.nShow = SW_SHOW;
  ShExecInfo.hInstApp = NULL;

  g_windowHelper.StopThread();

  LockSetForegroundWindow(LSFW_UNLOCK);
  ShowWindow(g_hWnd,SW_MINIMIZE);
  ret = ShellExecuteExW(&ShExecInfo) == TRUE;
  g_windowHelper.SetHANDLE(ShExecInfo.hProcess);

  // ShellExecute doesn't return the window of the started process
  // we need to gather it from somewhere to allow switch back to XBMC
  // when a program is minimized instead of stopped.
  //g_windowHelper.SetHWND(ShExecInfo.hwnd);
  g_windowHelper.Create();

  if(bWaitForScriptExit)
  {
    // Todo: Pause music and video playback
    WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
  }

  return ret;
}
开发者ID:Saddamisalami,项目名称:xbmc,代码行数:72,代码来源:WIN32Util.cpp

示例13: Update

void CGUIWindowVideoInfo::Update()
{
  CStdString strTmp;
  strTmp = m_movieItem->GetVideoInfoTag()->m_strTitle; strTmp.Trim();
  SetLabel(CONTROL_TITLE, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strDirector; strTmp.Trim();
  SetLabel(CONTROL_DIRECTOR, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strStudio; strTmp.Trim();
  SetLabel(CONTROL_STUDIO, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strWritingCredits; strTmp.Trim();
  SetLabel(CONTROL_CREDITS, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strGenre; strTmp.Trim();
  SetLabel(CONTROL_GENRE, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strTagLine; strTmp.Trim();
  SetLabel(CONTROL_TAGLINE, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strPlotOutline; strTmp.Trim();
  SetLabel(CONTROL_PLOTOUTLINE, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strTrailer; strTmp.Trim();
  SetLabel(CONTROL_TRAILER, strTmp);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strMPAARating; strTmp.Trim();
  SetLabel(CONTROL_MPAARATING, strTmp);

  CStdString strTop250;
  if (m_movieItem->GetVideoInfoTag()->m_iTop250)
    strTop250.Format("%i", m_movieItem->GetVideoInfoTag()->m_iTop250);
  SetLabel(CONTROL_TOP250, strTop250);

  CStdString strYear;
  if (m_movieItem->GetVideoInfoTag()->m_iYear)
    strYear.Format("%i", m_movieItem->GetVideoInfoTag()->m_iYear);
  else
    strYear = g_infoManager.GetItemLabel(m_movieItem.get(),LISTITEM_PREMIERED);
  SetLabel(CONTROL_YEAR, strYear);

  CStdString strRating_And_Votes;
  if (m_movieItem->GetVideoInfoTag()->m_fRating != 0.0f)  // only non-zero ratings are of interest
    strRating_And_Votes.Format("%03.1f (%s %s)", m_movieItem->GetVideoInfoTag()->m_fRating, m_movieItem->GetVideoInfoTag()->m_strVotes, g_localizeStrings.Get(20350));
  SetLabel(CONTROL_RATING_AND_VOTES, strRating_And_Votes);

  strTmp = m_movieItem->GetVideoInfoTag()->m_strRuntime; strTmp.Trim();
  SetLabel(CONTROL_RUNTIME, strTmp);

  // setup plot text area
  strTmp = m_movieItem->GetVideoInfoTag()->m_strPlot;
  if (!(!m_movieItem->GetVideoInfoTag()->m_strShowTitle.IsEmpty() && m_movieItem->GetVideoInfoTag()->m_iSeason == 0)) // dont apply to tvshows
    if (m_movieItem->GetVideoInfoTag()->m_playCount == 0 && g_guiSettings.GetBool("videolibrary.hideplots"))
      strTmp = g_localizeStrings.Get(20370);

  strTmp.Trim();
  SetLabel(CONTROL_TEXTAREA, strTmp);

  CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_castList);
  OnMessage(msg);

  if (m_bViewReview)
  {
    if (!m_movieItem->GetVideoInfoTag()->m_strArtist.IsEmpty())
    {
      SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 133);
    }
    else
    {
      SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 206);
    }

    SET_CONTROL_HIDDEN(CONTROL_LIST);
    SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
  }
  else
  {
    SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 207);

    SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
    SET_CONTROL_VISIBLE(CONTROL_LIST);
  }

  // Check for resumability
  CGUIWindowVideoFiles *window = (CGUIWindowVideoFiles *)m_gWindowManager.GetWindow(WINDOW_VIDEO_FILES);
  if (window && window->GetResumeItemOffset(m_movieItem.get()) > 0)
    CONTROL_ENABLE(CONTROL_BTN_RESUME);
  else
    CONTROL_DISABLE(CONTROL_BTN_RESUME);

  CONTROL_ENABLE(CONTROL_BTN_PLAY);

  // update the thumbnail
  const CGUIControl* pControl = GetControl(CONTROL_IMAGE);
  if (pControl)
  {
    CGUIImage* pImageControl = (CGUIImage*)pControl;
    pImageControl->FreeResources();
    pImageControl->SetFileName(m_movieItem->GetThumbnailImage());
//.........这里部分代码省略.........
开发者ID:derobert,项目名称:debianlink-xbmc,代码行数:101,代码来源:GUIWindowVideoInfo.cpp

示例14: PrepareDocId

CStdString IntelligentDocInfo::PrepareDocId(CStdString sDocId)
{
	sDocId.Trim();
	sDocId.MakeLower();
	return sDocId;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:6,代码来源:IntelligentDocInfo.cpp

示例15: Update

void CGUIDialogVideoInfo::Update()
{
  // setup plot text area
  CStdString strTmp = m_movieItem->GetVideoInfoTag()->m_strPlot;
  if (!(!m_movieItem->GetVideoInfoTag()->m_strShowTitle.IsEmpty() && m_movieItem->GetVideoInfoTag()->m_iSeason == 0)) // dont apply to tvshows
    if (m_movieItem->GetVideoInfoTag()->m_playCount == 0 && !g_guiSettings.GetBool("videolibrary.showunwatchedplots"))
      strTmp = g_localizeStrings.Get(20370);

  strTmp.Trim();
  SetLabel(CONTROL_TEXTAREA, strTmp);

  CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_castList);
  OnMessage(msg);

  if (GetControl(CONTROL_BTN_TRACKS)) // if no CONTROL_BTN_TRACKS found - allow skinner full visibility control over CONTROL_TEXTAREA and CONTROL_LIST
  {
    if (m_bViewReview)
    {
      if (!m_movieItem->GetVideoInfoTag()->m_strArtist.IsEmpty())
      {
        SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 133);
      }
      else
      {
        SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 206);
      }

      SET_CONTROL_HIDDEN(CONTROL_LIST);
      SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
    }
    else
    {
      SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 207);

      SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
      SET_CONTROL_VISIBLE(CONTROL_LIST);
    }
  }

  // Check for resumability
  if (CGUIWindowVideoBase::GetResumeItemOffset(m_movieItem.get()) > 0)
    CONTROL_ENABLE(CONTROL_BTN_RESUME);
  else
    CONTROL_DISABLE(CONTROL_BTN_RESUME);

  CONTROL_ENABLE(CONTROL_BTN_PLAY);

  // update the thumbnail
  const CGUIControl* pControl = GetControl(CONTROL_IMAGE);
  if (pControl)
  {
    CGUIImage* pImageControl = (CGUIImage*)pControl;
    pImageControl->FreeResources();
    pImageControl->SetFileName(m_movieItem->GetThumbnailImage());
  }
  // tell our GUI to completely reload all controls (as some of them
  // are likely to have had this image in use so will need refreshing)
  if (m_hasUpdatedThumb)
  {
    CGUIMessage reload(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS);
    g_windowManager.SendMessage(reload);
  }
}
开发者ID:Ayu222,项目名称:android,代码行数:63,代码来源:GUIDialogVideoInfo.cpp


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