BLOG ARTICLE 프로그래밍/C++ | 46 ARTICLE FOUND

  1. 2011.01.18 AIX C++ SOCKET NODELAY 셋팅법
  2. 2010.04.27 otl에서 오라클 프로시져 호출
  3. 2010.04.14 C++ timer 사용해서 수행시간 알아내기
  4. 2010.03.26 파일 이동 하기
  5. 2010.03.26 STL string 문자 치환하기 1

#include <netinet/tcp.h>

...

int on=1;

 setsockopt(m_nLsnSocketHandle, IPPROTO_TCP, TCP_NODELAYACK, &on, sizeof(on));
AND

otl_stream o;
try{ 
  o.open(1, // buffer size should be equal to 1 in case of stored procedure call 
         "begin PROC_CERT_VALIDATION(:V_DN<char[4000],in>,:V_CERTSTAT<char[33],out> ); end;",
          dbconn// connect object 
         ); 

    o.set_commit(0); 
    o<<pszDN; 

    char pszStat[32]; 
    o>>pszStat; 

   if (memcmp(pszStat,"GOOD",4)==0) nResult=0;
   else nResult = -1;
   o.close();
  
   return 0;
 
 }
 catch( otl_exception &p )
 {
  ///< intercept OTL exceptions
  printf("%s",p.msg);
 }

 // failed
 o.close();

AND

#include <time.h>
init=clock();

...작업수행.....

final=clock()-init;

char pszsec[50];
sprintf(pszsec,"%f",final/1000.0);

pszsec<-수행시간 (예 : 0.55555)
AND

#include <stdio.h>

rename(m_pLogFileName,cNewFileName);

m_pLogFileName <- 이동원본파일명
cNewFileName <- MOVE 될 파일명

AND

void ReplaceAll (string& strSrc, const string& strFind, const string& strDest)  
{  
   size_t j;  
 
   while ((j = strSrc.find(strFind)) != string::npos)  
        strSrc.replace(j, strFind.length(), strDest);  
}

사용법 : ReplaceAll(strtimebuf,"/","");
         strtimebuf <- 원본문자열 ReplaceAll을 수행하고나면 원본문자열변수가 변경된다.

AND