코드조각
-
엑셀 테이블에서 공백 컬럼 있는지 체크하는 코드 샘플 c#프로그래밍/코드 조각 2018. 6. 16. 12:15
private void btnEmptyCheck_Click(object sender, EventArgs e){ var app = new Excel.Application(); try { var checkedFileNames = CheckedFileNames; int count = checkedFileNames.Count; int prog = 0; foreach (string fileName in checkedFileNames) { string fullPathName = Path.Combine(Path.GetFullPath(path), fileName); CheckEmptySpace(app, fullPathName); string completeMessage = fileName + string.Format(..
-
c++ 문자열 스플릿프로그래밍/코드 조각 2018. 5. 10. 19:59
#include #include #include std::vector SplitString(const std::string& source, const std::string& spliters){ const std::regex r{ spliters }; std::sregex_token_iterator begin{ source.begin(), source.end(), r, -1 }; std::sregex_token_iterator end{}; std::vector tokens; tokens.reserve(std::distance(begin, end)); for (auto i = begin; i != end; ++i) { tokens.push_back(*i); } return tokens;} 샘플 코드int m..
-
Parse std::string with boost ptree프로그래밍/코드 조각 2016. 6. 16. 01:53
1234567891011121314151617181920212223#include #include #include #include #include namespace pt = boost::property_tree; std::string ss = "{ \"item1\" : 123, \"item2\" : 456, \"item3\" : 789 }"; int main(){ // Read json. pt::ptree pt2; boost::iostreams::array_source as(&ss[0], ss.size()); boost::iostreams::stream is(as); pt::read_json(is, pt2); std::cout
-
유니티 json(JsonUtility) 송신 => c++서버 json 수신프로그래밍/의문 2016. 3. 29. 14:33
Json Utility는 유니티 5.3 버전에서의 추가된 사항으로, 유니티에서 직접 제공하는 json 라이브러리입니다.외부 라이브러리를 사용하지 않고도 json 작성을 가능하게 합니다. 이전 버전에서 json을 사용하려면 외부 라이브러리를 썼다고 하는데 기기에 따라 호환이 안 되는 경우가 많아,게임 하나에 json 라이브러리만 2개 이상인 경우도 많았다고 합니다. #클라이언트 사이드- 유니티 5.3버전 JsonUtility 사용 #서버 사이드- boost/property_tree/json_parser 사용 #유니티 클라이언트 코드 0) 프로토콜 정의12345678 namespace Json { public class ReqLogin { public string id; public string pw; } ..