|
@@ -772,6 +772,24 @@ unsigned cmCsvInsertSymDouble( cmCsvH_t h, double v )
|
772
|
772
|
|
773
|
773
|
}
|
774
|
774
|
|
|
775
|
+cmCsvRC_t cmCsvSetCellIdent( cmCsvH_t h, unsigned row, unsigned col, const char* text )
|
|
776
|
+{
|
|
777
|
+ cmCsvCell_t* cp;
|
|
778
|
+ unsigned symId;
|
|
779
|
+
|
|
780
|
+ if((cp = _cmCsvCellPtr(h,row,col)) == NULL )
|
|
781
|
+ return cmErrLastRC(&_cmCsvHandleToPtr(h)->err);
|
|
782
|
+
|
|
783
|
+ if((symId = cmCsvInsertSymText(h,text)) == cmInvalidId )
|
|
784
|
+ return cmErrLastRC(&_cmCsvHandleToPtr(h)->err);
|
|
785
|
+
|
|
786
|
+ cp->symId = symId;
|
|
787
|
+ cp->flags &= !kTypeTMask;
|
|
788
|
+ cp->flags |= kIdentCsvTFl;
|
|
789
|
+
|
|
790
|
+ return kOkCsvRC;
|
|
791
|
+}
|
|
792
|
+
|
775
|
793
|
cmCsvRC_t cmCsvSetCellText( cmCsvH_t h, unsigned row, unsigned col, const char* text )
|
776
|
794
|
{
|
777
|
795
|
cmCsvCell_t* cp;
|
|
@@ -1011,7 +1029,23 @@ cmCsvRC_t cmCsvInsertColAfter( cmCsvH_t h, cmCsvCell_t* leftCellPtr, cmCsvCell_
|
1011
|
1029
|
|
1012
|
1030
|
}
|
1013
|
1031
|
|
1014
|
|
-cmCsvRC_t cmCsvInsertTextColAfter( cmCsvH_t h, cmCsvCell_t* leftCellPtr, cmCsvCell_t** cellPtrPtr, const char* text, unsigned lexTId )
|
|
1032
|
+cmCsvRC_t cmCsvInsertIdentColAfter( cmCsvH_t h, cmCsvCell_t* leftCellPtr, cmCsvCell_t** cellPtrPtr, const char* text, unsigned lexTId )
|
|
1033
|
+{
|
|
1034
|
+ cmCsvRC_t rc;
|
|
1035
|
+ cmCsvCell_t* ncp;
|
|
1036
|
+
|
|
1037
|
+ if( cellPtrPtr != NULL )
|
|
1038
|
+ *cellPtrPtr = NULL;
|
|
1039
|
+
|
|
1040
|
+ if((rc = cmCsvInsertColAfter(h, leftCellPtr, &ncp, cmInvalidId, 0, lexTId )) == kOkCsvRC )
|
|
1041
|
+ if((rc = cmCsvSetCellIdent(h, ncp->row, ncp->col, text )) == kOkCsvRC )
|
|
1042
|
+ if( cellPtrPtr != NULL )
|
|
1043
|
+ *cellPtrPtr = ncp;
|
|
1044
|
+
|
|
1045
|
+ return rc;
|
|
1046
|
+}
|
|
1047
|
+
|
|
1048
|
+cmCsvRC_t cmCsvInsertQTextColAfter( cmCsvH_t h, cmCsvCell_t* leftCellPtr, cmCsvCell_t** cellPtrPtr, const char* text, unsigned lexTId )
|
1015
|
1049
|
{
|
1016
|
1050
|
cmCsvRC_t rc;
|
1017
|
1051
|
cmCsvCell_t* ncp;
|
|
@@ -1137,12 +1171,12 @@ cmCsvRC_t cmCsvWrite( cmCsvH_t h, const char* fn )
|
1137
|
1171
|
if((tp = cmHashTblStr(p->htH,cp->symId)) == NULL )
|
1138
|
1172
|
return _cmCsvError(p,kHashTblErrCsvRC,"Unable to locate the symbol text for cell at row:%i col:%i.",cp->row,cp->col);
|
1139
|
1173
|
|
1140
|
|
- if( cmIsFlag(cp->flags,kTextTMask) )
|
|
1174
|
+ if( cmIsFlag(cp->flags,kStrCsvTFl) )
|
1141
|
1175
|
fprintf(fp,"\"");
|
1142
|
1176
|
|
1143
|
1177
|
fputs(tp,fp);
|
1144
|
1178
|
|
1145
|
|
- if( cmIsFlag(cp->flags,kTextTMask) )
|
|
1179
|
+ if( cmIsFlag(cp->flags,kStrCsvTFl) )
|
1146
|
1180
|
fprintf(fp,"\"");
|
1147
|
1181
|
|
1148
|
1182
|
cp = cp->rowPtr;
|