Click here to Skip to main content
15,892,737 members
Articles / Desktop Programming / MFC

Visual Studio Bookmark Saver Add-In

Rate me:
Please Sign up or sign in to vote.
4.69/5 (8 votes)
6 Feb 2000 91.4K   1.5K   36  
Visual Studio add-in which saves and restores bookmarks after closing and re-opening a file.
// BkMrkFile.h: interface for the CBkMrkFile class.
//
//////////////////////////////////////////////////////////////////////
// Copyright (C) 1998, 1999, 2000   Jignesh Patel
// All rights reserved. May not be sold for profit.

#if !defined(AFX_BKMRKFILE_H__90BE6AC1_204B_11D2_8044_0060B0C17174__INCLUDED_)
#define AFX_BKMRKFILE_H__90BE6AC1_204B_11D2_8044_0060B0C17174__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

class CBkMrkFile : public CObject  
{
	DECLARE_SERIAL (CBkMrkFile)

public:
	bool RemoveBookMarkLineNumber(long nLineNumber);
	bool DoesFileExist();
	bool ClearBookMarks();
	bool SetFileName(const CString & strFileName);
	bool GetFileName(CString & strFileName);
	bool AddBookMarkLineNumber(long nLineNumber, CString strText = "");
	long GetNextBookMark(int &nIndex, CString & strLineText);
	long GetFirstBookMark(int & nIndex, CString & strLineText);
	CBkMrkFile();
	virtual ~CBkMrkFile();
	bool LookUpBookMarkLineNumber(long nLineNumber, int * nIndex = NULL);

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	virtual void Serialize (CArchive& ar);

private:
	void ReadVersion1(CArchive &ar);
	void ReadVersion0(CArchive & ar);
	CString				m_strFileName;
	CArray<long, long>	m_aryLineNumbers;
	CArray<CString, CString> m_aryStrLineText;
};

#endif // !defined(AFX_BKMRKFILE_H__90BE6AC1_204B_11D2_8044_0060B0C17174__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions