com.hcl.domino.jna.internal.ItemDecoder Maven / Gradle / Ivy
/*
* ==========================================================================
* Copyright (C) 2019-2022 HCL America, Inc. ( http://www.hcl.com/ )
* All rights reserved.
* ==========================================================================
* Licensed under the Apache License, Version 2.0 (the "License"). You may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at .
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
* ==========================================================================
*/
package com.hcl.domino.jna.internal;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.TimeZone;
import com.hcl.domino.commons.data.DefaultDominoDateRange;
import com.hcl.domino.commons.richtext.RichTextUtil;
import com.hcl.domino.commons.util.NotesDateTimeUtils;
import com.hcl.domino.commons.util.NotesErrorUtils;
import com.hcl.domino.data.DominoDateTime;
import com.hcl.domino.data.ItemDataType;
import com.hcl.domino.jna.data.JNADominoDateTime;
import com.hcl.domino.jna.internal.capi.NotesCAPI;
import com.hcl.domino.jna.internal.structs.NotesNumberPairStruct;
import com.hcl.domino.jna.internal.structs.NotesRangeStruct;
import com.hcl.domino.jna.internal.structs.NotesTimeDatePairStruct;
import com.hcl.domino.jna.internal.structs.NotesTimeDateStruct;
import com.hcl.domino.misc.DominoEnumUtil;
import com.hcl.domino.richtext.records.RecordType;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.ShortByReference;
public class ItemDecoder {
public static double decodeNumber(Pointer ptr, int valueLength) {
double numVal = ptr.getDouble(0);
return numVal;
}
public static Object decodeTextValue(Pointer ptr, int valueLength, boolean convertStringsLazily) {
if (valueLength<=0) {
return ""; //$NON-NLS-1$
}
if (convertStringsLazily) {
byte[] stringDataArr = new byte[valueLength];
ptr.read(0, stringDataArr, 0, valueLength);
LMBCSString lmbcsString = new LMBCSString(stringDataArr);
return lmbcsString;
}
else {
String txtVal = NotesStringUtils.fromLMBCS(ptr, valueLength);
return txtVal;
}
}
public static List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy