本文整理汇总了C++中wyString::SetAs方法的典型用法代码示例。如果您正苦于以下问题:C++ wyString::SetAs方法的具体用法?C++ wyString::SetAs怎么用?C++ wyString::SetAs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wyString
的用法示例。
在下文中一共展示了wyString::SetAs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMessage
void
EditorBase::GetCompleteTextByPost(wyString &query, MDIWindow *wnd)
{
wyUInt32 nstrlen;
wyChar *data;
THREAD_MSG_PARAM tmp = {0};
//set the lparam sent
if(GetWindowThreadProcessId(m_hwnd , NULL) == GetCurrentThreadId())
{
nstrlen = SendMessage(m_hwnd, SCI_GETTEXTLENGTH, 0, 0);
data = AllocateBuff(nstrlen + 1);
SendMessage(m_hwnd, SCI_GETTEXT, (WPARAM)nstrlen+1, (LPARAM)data);
query.SetAs(data);
free(data);
}
else
{
if(WaitForSingleObject(pGlobals->m_pcmainwin->m_sqlyogcloseevent, 0) != WAIT_OBJECT_0 )
{
query.SetAs("");
return;
}
tmp.m_lparam = (LPARAM)&query;
tmp.m_hevent = CreateEvent(NULL, TRUE, FALSE, NULL);
//now post the message to ui thread and wait for the event to be set
PostMessage(wnd->GetHwnd(), UM_GETEDITORTEXT, (WPARAM)this->GetHWND(), (LPARAM)&tmp);
if(WaitForSingleObject(tmp.m_hevent, 10000) == WAIT_TIMEOUT)
{
//CloseHandle(tmp.m_hevent);
query.SetAs("");
//return;
}
//WaitForSingleObject(tmp.m_hevent, INFINITE);
//close the event handle
CloseHandle(tmp.m_hevent);
tmp.m_hevent = NULL;
//data = (wyChar*)tmp.m_lparam;
}
return;
}
示例2:
//function to get the banner text
void
TableView::GetBanner(wyString& bannertext)
{
bannertext.Clear();
//set the text
if(!m_mydata || !m_mydata->m_table.GetLength() || !m_mydata->m_db.GetLength())
{
bannertext.SetAs(_("Select a Table/View from the Object Browser"));
}
}
示例3: OnError
// Function to get the path the selected item in a Treeview //
wyBool
FavoriteBase::SelItemPath(HWND htree, HTREEITEM item, wyString &fullpath, wyBool bFileFlag)
{
wyWChar data[MAX_PATH + 1] = {0};
wyWChar foldpath[MAX_PATH + 1] = {0};
TVITEM tvitem;
wyString path, temp, temp2, datastr, foldpathstr;
// application data path //
if(!pGlobals->m_configdirpath.GetLength())
{
if(!SUCCEEDED(::SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, foldpath)))
return OnError(_("Error in favorites"));
wcscat(foldpath ,L"\\SQLyog");
}
else
{
//wcscpy(foldpath, pGlobals->m_configdirpath.GetAsWideChar());
wcsncpy(foldpath, pGlobals->m_configdirpath.GetAsWideChar(), MAX_PATH);
foldpath[MAX_PATH] = '\0';
}
while(item)
{
tvitem.mask = TVIF_TEXT | TVIF_IMAGE;
tvitem.hItem = item;
tvitem.cchTextMax = MAX_PATH;
tvitem.pszText = data ;
TreeView_GetItem(htree, &tvitem);
datastr.SetAs(data);
if(tvitem.iImage != NFILE || !bFileFlag)
{
temp.Sprintf("\\%s", datastr.GetString());
if(path.GetLength() > 0)
{
temp2.SetAs(path);
path.Sprintf("\\%s%s", datastr.GetString(), temp2.GetString());
}
else
path.Sprintf("\\%s", datastr.GetString());
}
item = TreeView_GetParent(htree, item);
}
foldpathstr.SetAs(foldpath);
fullpath.SetAs(foldpathstr.GetString());
fullpath.Add(path.GetString());
return wyTrue;
}
示例4: InitOpenFile
wyBool
InitOpenFile(HWND hwnd, wyString &filename, wyInt32 filter, wyInt32 bufsize)
{
wyWChar file[MAX_PATH] = {0};
wyBool ret;
ret = InitOpenFile(hwnd, file, filter, bufsize);
filename.SetAs(file);
return ret;
}
示例5: row
void
EditorBase::AddResultMsg(Tunnel * tunnel, MYSQL_RES * myres, wyString& errorormsg, wyUInt32 timetaken)
{
wyUInt32 rowsret;
wyString newmsg;
rowsret = (wyUInt32)tunnel->mysql_num_rows(myres);
VERIFY(newmsg.Sprintf(_("(%lu row(s) returned)\n(%d ms taken)\n\n"), rowsret, timetaken ) < SIZE_128);
errorormsg.SetAs(newmsg);
return;
}
示例6: AllocateBuff
wyBool
ExportAsSimpleSQL::AddValues(ExportSQLData *data, wyString &value)
{
wyInt32 count, last, lenrow;
wyString temp, resrow, buffer;
wyInt32 *lengths = NULL;
wyInt32 escapeddatalen;
wyBool startflag = wyFalse;
if(WriteToFile(value) == wyFalse)
return wyFalse;
//this condition is true if export from from result tab if result set is not edited
if(!data->m_tabrec->m_rowarray)
{
if(m_isdatafromquery == wyTrue)
{
lengths = (wyInt32 *)sja_mysql_fetch_lengths(m_tunnel, m_myres);
}
else
{
lengths = (wyInt32 *)m_rowlength;
}
}
for(count = 0; count < data->m_result->field_count; count++)
{
if(data->m_selcol[count] == wyFalse)
continue;
if(startflag == wyTrue)
buffer.Add(",");
/// Check for NULL value or not
if(!m_myrow[count])
{
buffer.Add("NULL");
startflag = wyTrue;
continue;
}
if(m_escapeddata)
free(m_escapeddata);
//This condion true if the result tab in table tab or edit mode or result set is edited
if(!lengths)
{
resrow.SetAs(m_myrow[count]);
lenrow = resrow.GetLength();
}
else
{
lenrow = lengths[count];
}
//It requires double buffer bcs the real_escape_string returns 2 char for special chars like '\'
escapeddatalen = (lenrow * 2) + 1;
m_escapeddata = AllocateBuff(escapeddatalen);
last = sja_mysql_real_escape_string(m_tunnel, *m_mysql, m_escapeddata, m_myrow[count], lenrow);
m_escapeddata[last] = 0;
buffer.Add("'");
startflag = wyTrue;
buffer.Add(m_escapeddata);
buffer.Add("'");
}
//Write to file
WriteToFile(buffer);
buffer.SetAs("");
value.SetAs("");
return wyTrue;
}